From f7c4643311ff052e70194b7e0e77c5d6d5449537 Mon Sep 17 00:00:00 2001 From: Alexander Janssen Date: Tue, 19 Sep 2017 10:13:51 +0200 Subject: [PATCH] Fix some issue with 0 values and sorting of the args --- lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php | 1 + lib/Doctrine/ORM/Query/SqlWalker.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php index 1f6fa277bca..fd398d942ea 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php @@ -309,6 +309,7 @@ protected function gatherRowData(array $data, array &$id, array &$nonemptyCompon foreach ($rowData['newObjects'] as $objIndex => $newObject) { $class = $newObject['class']; $args = $newObject['args']; + ksort($args); $obj = $class->newInstanceArgs($args); $rowData['newObjects'][$objIndex]['obj'] = $obj; diff --git a/lib/Doctrine/ORM/Query/SqlWalker.php b/lib/Doctrine/ORM/Query/SqlWalker.php index 837a10d9b72..6d552bdb5a5 100644 --- a/lib/Doctrine/ORM/Query/SqlWalker.php +++ b/lib/Doctrine/ORM/Query/SqlWalker.php @@ -1648,7 +1648,7 @@ public function walkNewObject($newObjectExpression, $newObjectResultAlias = null 'argIndex' => $argIndex, ]; - if ($objOwner) { + if ($objOwner !== null) { $this->rsm->addNewObjectAsArgument($objIndex, $objOwner, $objOwnerIdx); } }