Continued:
[core.git] / inc / classes / main / database / class_BaseDatabaseWrapper.php
index 866a6c23f9f569bdf4a2a600c66ea04a0ddd9e8a..cd785bb7ca341fca74e297b9a712df52f902aaab 100644 (file)
@@ -145,8 +145,14 @@ class BaseDatabaseWrapper extends BaseFrameworkSystem {
         * @return      $resultInstance         An instance of a database result class
         */
        public function doSelectByCriteria (Criteria $criteriaInstance, array $onlyKeys = array()) {
-               // First get a key suitable for our cache and extend it with this class name
-               $cacheKey = $this->getCacheKeyByCriteria($criteriaInstance, $onlyKeys);
+               // Default cache key if cache is not enabled
+               $cacheKey = NULL;
+
+               // Is the 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($criteriaInstance, $onlyKeys);
+               } // END - if
 
                // Does this key exists in cache?
                if (($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === TRUE) && ($this->cacheInstance->offsetExists($cacheKey, BaseDatabaseBackend::RESULT_INDEX_ROWS, 1))) {