diff options
author | xue <> | 2007-10-11 12:24:49 +0000 |
---|---|---|
committer | xue <> | 2007-10-11 12:24:49 +0000 |
commit | d92c791ab6be7a5ba9e776fe5ba6b08e7b9c4c9f (patch) | |
tree | 716192bc74cad93d907df3515efd3ed2f06ee3fc /framework | |
parent | dfccce242deef5b89049516390a3308795878be9 (diff) |
refactored a bit about AR
Diffstat (limited to 'framework')
-rw-r--r-- | framework/Data/ActiveRecord/TActiveRecord.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/framework/Data/ActiveRecord/TActiveRecord.php b/framework/Data/ActiveRecord/TActiveRecord.php index 446c87e4..f28b81e4 100644 --- a/framework/Data/ActiveRecord/TActiveRecord.php +++ b/framework/Data/ActiveRecord/TActiveRecord.php @@ -199,9 +199,11 @@ abstract class TActiveRecord extends TComponent public function getDbConnection() { if($this->_connection===null) - $this->_connection=self::getRecordManager()->getDbConnection(); - if($this->_connection===null) //check it - throw new TActiveRecordException('ar_invalid_db_connection',get_class($this)); + { + $this->setDbConnection(self::getRecordManager()->getDbConnection()); + if($this->_connection===null) //check it + throw new TActiveRecordException('ar_invalid_db_connection',get_class($this)); + } return $this->_connection; } |