* @return void
*/
protected function queryInsertDataSet (StoreableCriteria $dataSetInstance, array $onlyKeys = array()) {
- // First get a key suitable for our cache and extend it with this class name
- $cacheKey = $this->getCacheKeyByCriteria($dataSetInstance, $onlyKeys);
- //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-WRAPPER: Using cache key ' . $cacheKey . ' for purging ...');
+ // Default cache key is NULL
+ $cacheKey = NULL;
+
+ // Is cache enabled?
+ if ($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === TRUE) {
+ // First get a key suitable for our cache and extend it with this class name
+ $cacheKey = $this->getCacheKeyByCriteria($dataSetInstance, $onlyKeys);
+ //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-WRAPPER: Using cache key ' . $cacheKey . ' for purging ...');
+ } // END - if
// Does this key exists in cache?
- if ($this->cacheInstance->offsetExists($cacheKey)) {
+ if (($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === TRUE) && ($this->cacheInstance->offsetExists($cacheKey))) {
// Purge the cache
$this->cacheInstance->purgeOffset($cacheKey);
} // END - if
* @return void
*/
protected function queryUpdateDataSet (StoreableCriteria $dataSetInstance, array $onlyKeys = array()) {
- // First get a key suitable for our cache and extend it with this class name
- $cacheKey = $this->getCacheKeyByCriteria($dataSetInstance, $onlyKeys);
- //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-WRAPPER: Using cache key ' . $cacheKey . ' for purging ...');
+ // Init cache key
+ $cacheKey = NULL;
+
+ // Is cache enabled?
+ if ($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === TRUE) {
+ // First get a key suitable for our cache and extend it with this class name
+ $cacheKey = $this->getCacheKeyByCriteria($dataSetInstance, $onlyKeys);
+ //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-WRAPPER: Using cache key ' . $cacheKey . ' for purging ...');
+ } // END - if
// Does this key exists in cache?
- if ($this->cacheInstance->offsetExists($cacheKey)) {
+ if (($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === TRUE) && ($this->cacheInstance->offsetExists($cacheKey))) {
// Purge the cache
$this->cacheInstance->purgeOffset($cacheKey);
} // END - if