1
0
mirror of synced 2025-02-09 08:49:26 +03:00

#5854 - simple workaround to avoid populating SLC cache from DQL queries with multiple nested DQL aliases

This commit is contained in:
Marco Pivetta 2016-06-06 01:15:59 +02:00 committed by FabioBatSilva
parent d3f6c5ec70
commit 288e3191ce

View File

@ -261,6 +261,14 @@ class DefaultQueryCache implements QueryCache
// @TODO - move to cache hydration components
foreach ($rsm->relationMap as $alias => $name) {
$metadata = $this->em->getClassMetadata($rsm->aliasMap[$rsm->parentAliasMap[$alias]]);
$className = $metadata->getName();
if (! $entity instanceof $className) {
// this alias is not the root alias, therefore we skip it. $entity is always the root of the selection here
// @TODO should actually cache all aliases
continue;
}
$assoc = $metadata->associationMappings[$name];
if (($assocValue = $metadata->getFieldValue($entity, $name)) === null || $assocValue instanceof Proxy) {