diff --git a/lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php index a79f086ec..f3e4376f7 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php @@ -253,7 +253,7 @@ class ArrayHydrator extends AbstractHydrator $args = $newObject['args']; $obj = $class->newInstanceArgs($args); - if (count($args) == $scalarCount || ($scalarCount == 0 && count($rowData['newObjects']))) { + if (count($args) == $scalarCount || ($scalarCount == 0 && count($rowData['newObjects']) == 1)) { $result[$resultKey] = $obj; continue; diff --git a/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php index f7b37b38f..c8607d703 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php @@ -553,7 +553,7 @@ class ObjectHydrator extends AbstractHydrator $args = $newObject['args']; $obj = $class->newInstanceArgs($args); - if (count($args) == $scalarCount || ($scalarCount == 0 && count($rowData['newObjects']))) { + if (count($args) == $scalarCount || ($scalarCount == 0 && count($rowData['newObjects']) == 1 )) { $result[$resultKey] = $obj; continue;