diff options
Diffstat (limited to 'framework')
-rw-r--r-- | framework/Web/UI/TPage.php | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/framework/Web/UI/TPage.php b/framework/Web/UI/TPage.php index 82e1f0ae..b1f59b3c 100644 --- a/framework/Web/UI/TPage.php +++ b/framework/Web/UI/TPage.php @@ -1277,9 +1277,39 @@ class TPage extends TTemplateControl * @param TActiveRecord $arObj
* @author Daniel Sampedro <darthdaniel85@gmail.com>
*/
- public function tryToUpdateAR($arObj)
+ public function tryToUpdateAR($arObj, $throwExceptions = false)
{
-
+ $objAttrs = get_class_vars(get_class($arObj));
+ foreach (array_keys($objAttrs) as $key)
+ {
+ try
+ {
+ if ($key == "RELATIONS")
+ {
+ break;
+ }
+ $control = $this->{$key};
+ switch (get_class($control))
+ {
+ default:
+ case "TTextBox":
+ $arObj->{$key} = $control->Text;
+ break;
+ case "TCheckBox":
+ $arObj->{$key} = $control->Checked;
+ break;
+ case "TDatePicker":
+ $arObj->{$key} = $control->Date;
+ break;
+ }
+ } catch (Exception $ex)
+ {
+ if ($throwExceptions)
+ {
+ throw $ex;
+ }
+ }
+ }
}
}
|