summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorxue <>2007-10-15 03:27:35 +0000
committerxue <>2007-10-15 03:27:35 +0000
commite2bccd7bb43fbcce03ae26752c86c8c60033c9c6 (patch)
treee4fb7fd951be0b1b911026df77796cc51d83c45f /framework
parentd836550f3a36e09c3b491f6b6254172ecd2fee06 (diff)
improved automatic foreign objects creation.
Diffstat (limited to 'framework')
-rw-r--r--framework/Data/ActiveRecord/TActiveRecord.php8
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);
}