diff options
author | rojaro <> | 2009-11-01 20:54:03 +0000 |
---|---|---|
committer | rojaro <> | 2009-11-01 20:54:03 +0000 |
commit | 65dda2deb497d86ae96e12e62258776b71ebc7dc (patch) | |
tree | e19157ddcba2ffebf3b65ac75b4b2bd248a20630 /framework/Data | |
parent | fb86f3c26df2a3b27542ac669ddf9096ae27d428 (diff) |
merged active record default value bug fix which got lost when moving from trac to googlecode - see http://www.pradosoft.com/forum/index.php?topic=10603.0
Diffstat (limited to 'framework/Data')
-rw-r--r-- | framework/Data/ActiveRecord/TActiveRecordGateway.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/framework/Data/ActiveRecord/TActiveRecordGateway.php b/framework/Data/ActiveRecord/TActiveRecordGateway.php index e588b976..a61ae0ff 100644 --- a/framework/Data/ActiveRecord/TActiveRecordGateway.php +++ b/framework/Data/ActiveRecord/TActiveRecordGateway.php @@ -306,7 +306,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 +342,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), |