#6303 #6304 documenting why collisions in field name hydration in STI/JTI require additional information and checks in the hydration process
This commit is contained in:
parent
4cbcdb761a
commit
44f2e22f14
@ -294,6 +294,8 @@ abstract class AbstractHydrator
|
|||||||
$dqlAlias = $cacheKeyInfo['dqlAlias'];
|
$dqlAlias = $cacheKeyInfo['dqlAlias'];
|
||||||
$type = $cacheKeyInfo['type'];
|
$type = $cacheKeyInfo['type'];
|
||||||
|
|
||||||
|
// If there are field name collisions in the child class, then we need
|
||||||
|
// to only hydrate if we are looking at the correct discriminator value
|
||||||
if(
|
if(
|
||||||
isset($cacheKeyInfo['discriminatorColumn']) &&
|
isset($cacheKeyInfo['discriminatorColumn']) &&
|
||||||
isset($data[$cacheKeyInfo['discriminatorColumn']]) &&
|
isset($data[$cacheKeyInfo['discriminatorColumn']]) &&
|
||||||
@ -392,7 +394,9 @@ abstract class AbstractHydrator
|
|||||||
'dqlAlias' => $ownerMap,
|
'dqlAlias' => $ownerMap,
|
||||||
];
|
];
|
||||||
|
|
||||||
if($classMetadata->parentClasses && isset($this->_rsm->discriminatorColumns[$ownerMap])) {
|
// the current discriminator value must be saved in order to disambiguate fields hydration,
|
||||||
|
// should there be field name collisions
|
||||||
|
if ($classMetadata->parentClasses && isset($this->_rsm->discriminatorColumns[$ownerMap])) {
|
||||||
return $this->_cache[$key] = \array_merge(
|
return $this->_cache[$key] = \array_merge(
|
||||||
$columnInfo,
|
$columnInfo,
|
||||||
[
|
[
|
||||||
|
Loading…
x
Reference in New Issue
Block a user