diff options
Diffstat (limited to 'framework/DataAccess/TSQLMap.php')
-rw-r--r-- | framework/DataAccess/TSQLMap.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/framework/DataAccess/TSQLMap.php b/framework/DataAccess/TSQLMap.php index 27973047..956593de 100644 --- a/framework/DataAccess/TSQLMap.php +++ b/framework/DataAccess/TSQLMap.php @@ -11,6 +11,11 @@ class TSQLMap extends TModule */
const CONFIG_FILE_EXT='.xml';
+ protected function getCacheKey()
+ {
+ return $this->getID().$this->getConfigFile();
+ }
+
/**
* Saves the current sqlmap instance to cache.
* @return boolean true if sqlmap was cached, false otherwise.
@@ -21,7 +26,7 @@ class TSQLMap extends TModule {
$cache = $this->getApplication()->getCache();
if(!is_null($cache))
- return $cache->add($this->getID(), $this->_sqlmap);
+ return $cache->add($this->getCacheKey(), $this->_sqlmap);
}
return false;
}
@@ -37,7 +42,7 @@ class TSQLMap extends TModule $cache = $this->getApplication()->getCache();
Prado::using('System.DataAccess.SQLMap.TSqlMapper');
if(!is_null($cache))
- $this->_sqlmap = $cache->get($this->getID());
+ $this->_sqlmap = $cache->get($this->getCacheKey());
return $this->_sqlmap instanceof TSqlMapper;
}
return false;
|