summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxue <>2007-10-11 12:24:49 +0000
committerxue <>2007-10-11 12:24:49 +0000
commitd92c791ab6be7a5ba9e776fe5ba6b08e7b9c4c9f (patch)
tree716192bc74cad93d907df3515efd3ed2f06ee3fc
parentdfccce242deef5b89049516390a3308795878be9 (diff)
refactored a bit about AR
-rw-r--r--framework/Data/ActiveRecord/TActiveRecord.php8
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;
}