1
0
mirror of synced 2025-01-31 12:32:59 +03:00

Can cache empty collections

I should be able to cache an "empty" collection.

I have a some objects, where 90% of these have on-to-many relations with zero associated elements.
This causes doctrine to run a query each time, instead of cache it as empty relation.
This commit is contained in:
Asmir Mustafic 2014-02-11 14:59:31 +01:00
parent e8f51acdb2
commit 1c94c16234

View File

@ -543,7 +543,7 @@ abstract class AbstractEntityPersister implements CachedEntityPersister
$list = $this->persister->loadOneToManyCollection($assoc, $sourceEntity, $coll); $list = $this->persister->loadOneToManyCollection($assoc, $sourceEntity, $coll);
if ($hasCache && ! empty($list)) { if ($hasCache) {
$persister->storeCollectionCache($key, $list); $persister->storeCollectionCache($key, $list);
if ($this->cacheLogger) { if ($this->cacheLogger) {