From db9c12f1aff1866aec0594a7035305b53fd86d07 Mon Sep 17 00:00:00 2001 From: Full Date: Sun, 2 Apr 2017 14:37:29 +0200 Subject: [PATCH] comparison on discriminator value with !== --- lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php index 062f54b31..95cffa125 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php @@ -297,10 +297,11 @@ abstract class AbstractHydrator if( isset($cacheKeyInfo['discriminatorColumn']) && isset($data[$cacheKeyInfo['discriminatorColumn']]) && - $data[$cacheKeyInfo['discriminatorColumn']] != $cacheKeyInfo['discriminatorValue'] + $data[$cacheKeyInfo['discriminatorColumn']] !== $cacheKeyInfo['discriminatorValue'] ){ break; } + // in an inheritance hierarchy the same field could be defined several times. // We overwrite this value so long we don't have a non-null value, that value we keep. // Per definition it cannot be that a field is defined several times and has several values.