From d92c791ab6be7a5ba9e776fe5ba6b08e7b9c4c9f Mon Sep 17 00:00:00 2001 From: xue <> Date: Thu, 11 Oct 2007 12:24:49 +0000 Subject: refactored a bit about AR --- framework/Data/ActiveRecord/TActiveRecord.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'framework/Data') 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; } -- cgit v1.2.3