From 419f0815c85a40639ac82c1ce05c80186a64dc55 Mon Sep 17 00:00:00 2001 From: wei <> Date: Tue, 1 May 2007 03:19:30 +0000 Subject: remove identity map in active record. --- .../ActiveRecord/TActiveRecordStateRegistry.php | 33 +--------------------- 1 file changed, 1 insertion(+), 32 deletions(-) (limited to 'framework/Data/ActiveRecord/TActiveRecordStateRegistry.php') diff --git a/framework/Data/ActiveRecord/TActiveRecordStateRegistry.php b/framework/Data/ActiveRecord/TActiveRecordStateRegistry.php index 691090dc..d6f24961 100644 --- a/framework/Data/ActiveRecord/TActiveRecordStateRegistry.php +++ b/framework/Data/ActiveRecord/TActiveRecordStateRegistry.php @@ -39,7 +39,7 @@ class TActiveRecordStateRegistry { private $_cleanObjects=array(); private $_removedObjects; - private $_cachedObjects=array(); + //private $_cachedObjects=array(); /** * Initialize the registry. */ @@ -48,37 +48,6 @@ class TActiveRecordStateRegistry $this->_removedObjects = new TList; } - /** - * Get the cached object for given type and row data. The cached object - * must also be clean. - * @param mixed row data fetched - * @return TActiveRecord cached object if found, null otherwise. - */ - public function getCachedInstance($data,$mustBeClean=true) - { - $key = $this->getObjectDataKey($data); - if(isset($this->_cachedObjects[$key])) - { - $obj = $this->_cachedObjects[$key]; - if(!($mustBeClean && !$this->getIsCleanObject($obj))) - return $obj; - } - } - - /** - * Cache the object that corresponding to the fetched row data. - * @param mixed row data fetched. - * @param TActiveRecord object to be cached. - * @return TActiveRecord cached object. - */ - public function addCachedInstance($data,$obj) - { - $key = $this->getObjectDataKey($data); - $this->registerClean($obj); - $this->_cachedObjects[$key]=$obj; - return $obj; - } - /** * @return string hash of the data. */ -- cgit v1.2.3