/** * {@inheritdoc} */ public function loadAll(array $criteria = array(), array $orderBy = null, $limit = null, $offset = null) { $timestamp = $this->timestampRegion->get($this->timestampKey); $query = $this->persister->getSelectSQL($criteria, null, null, $limit, $offset, $orderBy); $hash = $this->getHash($query, $criteria, null, null, null, $timestamp ? $timestamp->time : null); $rsm = $this->getResultSetMapping(); $querykey = new QueryCacheKey($hash, 0, Cache::MODE_NORMAL); $queryCache = $this->cache->getQueryCache($this->regionName); $result = $queryCache->get($querykey, $rsm); if ($result !== null) { if ($this->cacheLogger) { $this->cacheLogger->queryCacheHit($this->regionName, $querykey); } return $result; } $result = $this->persister->loadAll($criteria, $orderBy, $limit, $offset); $cached = $queryCache->put($querykey, $rsm, $result); if ($this->cacheLogger) { if ($result) { $this->cacheLogger->queryCacheMiss($this->regionName, $querykey); } if ($cached) { $this->cacheLogger->queryCachePut($this->regionName, $querykey); } } return $result; }