From 95b032891d6617525636cc7b680117dbb14afba7 Mon Sep 17 00:00:00 2001 From: "christophe.boulain" <> Date: Wed, 19 Jan 2011 14:56:01 +0000 Subject: Merge last changes on "Data" from trunk --- framework/Data/ActiveRecord/TActiveRecordGateway.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'framework/Data/ActiveRecord/TActiveRecordGateway.php') diff --git a/framework/Data/ActiveRecord/TActiveRecordGateway.php b/framework/Data/ActiveRecord/TActiveRecordGateway.php index e588b976..534bd253 100644 --- a/framework/Data/ActiveRecord/TActiveRecordGateway.php +++ b/framework/Data/ActiveRecord/TActiveRecordGateway.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2008 PradoSoft + * @copyright Copyright © 2005-2010 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @package System.Data.ActiveRecord @@ -42,6 +42,7 @@ class TActiveRecordGateway extends TComponent */ public function __construct(TActiveRecordManager $manager) { + parent::__construct(); $this->_manager=$manager; } @@ -306,7 +307,7 @@ class TActiveRecordGateway extends TComponent if($column->getIsExcluded()) continue; $value = $record->getColumnValue($name); - if(!$column->getAllowNull() && $value===null && !$column->hasSequence() && !$column->getDefaultValue()) + if(!$column->getAllowNull() && $value===null && !$column->hasSequence() && ($column->getDefaultValue() === TDbTableColumn::UNDEFINED_VALUE)) { throw new TActiveRecordException( 'ar_value_must_not_be_null', get_class($record), @@ -342,7 +343,7 @@ class TActiveRecordGateway extends TComponent if($column->getIsExcluded()) continue; $value = $record->getColumnValue($name); - if(!$column->getAllowNull() && $value===null) + if(!$column->getAllowNull() && $value===null && ($column->getDefaultValue() === TDbTableColumn::UNDEFINED_VALUE)) { throw new TActiveRecordException( 'ar_value_must_not_be_null', get_class($record), -- cgit v1.2.3