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:
parent
e8f51acdb2
commit
1c94c16234
@ -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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user