From 7e7921e32f3c89992c522af7bc4927c74b7b62c8 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 19 Aug 2017 15:58:50 +0200 Subject: [PATCH] #6303 #6304 documenting why the loose comparison is required --- 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 f430cb912..7c7e2ef81 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php @@ -297,8 +297,9 @@ abstract class AbstractHydrator if( isset($cacheKeyInfo['discriminatorColumn']) && isset($data[$cacheKeyInfo['discriminatorColumn']]) && + // Note: loose comparison required. See https://github.com/doctrine/doctrine2/pull/6304#issuecomment-323294442 $data[$cacheKeyInfo['discriminatorColumn']] != $cacheKeyInfo['discriminatorValue'] - ){ + ) { break; }