diff options
author | xue <> | 2007-10-15 03:27:35 +0000 |
---|---|---|
committer | xue <> | 2007-10-15 03:27:35 +0000 |
commit | e2bccd7bb43fbcce03ae26752c86c8c60033c9c6 (patch) | |
tree | e4fb7fd951be0b1b911026df77796cc51d83c45f /framework/Data | |
parent | d836550f3a36e09c3b491f6b6254172ecd2fee06 (diff) |
improved automatic foreign objects creation.
Diffstat (limited to 'framework/Data')
-rw-r--r-- | framework/Data/ActiveRecord/TActiveRecord.php | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/framework/Data/ActiveRecord/TActiveRecord.php b/framework/Data/ActiveRecord/TActiveRecord.php index 0b892a8f..3ad94073 100644 --- a/framework/Data/ActiveRecord/TActiveRecord.php +++ b/framework/Data/ActiveRecord/TActiveRecord.php @@ -202,10 +202,8 @@ abstract class TActiveRecord extends TComponent { if($this->hasRelation($name) && !$this->canGetProperty($name)) { - $name2=strtolower($name); - if(!isset($this->_foreignObjects[$name2])) - $this->fetchResultsFor($name2); - return $this->_foreignObjects[$name2]===false?null:$this->_foreignObjects[$name2]; + $this->fetchResultsFor($name); + return $this->$name; } return parent::__get($name); } @@ -221,7 +219,7 @@ abstract class TActiveRecord extends TComponent public function __set($name,$value) { if($this->hasRelation($name) && !$this->canSetProperty($name)) - $this->_foreignObjects[strtolower($name)]=$value===null?false:$value; + $this->$name=$value; else parent::__set($name,$value); } |