* @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))) {