* @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
} // END - foreach
// Is all found?
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: isFound=' . intval($isFound));
if ($isFound === TRUE) {
// Shall we skip this entry?
if ($searchInstance->getSkip() > 0) {
// We shall skip some entries
if ($skipFound < $searchInstance->getSkip()) {
// Skip this entry
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: Found entry, but skipping ...');
$skipFound++;
break;
} // END - if
} // END - foreach
// Write the data to a local file
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: Writing dataArray()=' . count($dataArray) . ' to ' . $dataFile . ' ...');
$this->writeDataArrayToFqfn($pathName . $dataFile, $dataArray);
// Count found entries up