From b7e522d7a73a182ad2137d761cfd13650a8aa86d Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei <kontakt@beberlei.de> Date: Tue, 15 Mar 2011 23:39:19 +0100 Subject: [PATCH] DDC-952 - This nasty inheritance hydration bug slipped in again, fixed again now. --- lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php index 54b39d90f..3524f89e9 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php @@ -115,7 +115,9 @@ class SimpleObjectHydrator extends AbstractHydrator ->convertToPHPValue($value, $this->_platform); } - if (isset($cache[$column])) { + // the second and part is to prevent overwrites in case of multiple + // inheritance classes using the same property name (See AbstractHydrator) + if (isset($cache[$column]) && (!isset($data[$cache[$column]['name']]) || $value !== null)) { $data[$cache[$column]['name']] = $value; } }