fixed for failing test case. when a single DTO is specified in the query, you no longer get a multidimensional array returned.
This commit is contained in:
parent
2ffda34f23
commit
c47a072815
@ -246,14 +246,15 @@ class ArrayHydrator extends AbstractHydrator
|
||||
$resultKey = $this->_resultCounter - 1;
|
||||
}
|
||||
|
||||
$count = count($rowData['newObjects']);
|
||||
$scalarCount = (isset($rowData['scalars'])? count($rowData['scalars']): 0);
|
||||
|
||||
foreach ($rowData['newObjects'] as $objIndex => $newObject) {
|
||||
$class = $newObject['class'];
|
||||
$args = $newObject['args'];
|
||||
$obj = $class->newInstanceArgs($args);
|
||||
|
||||
if ($count === 1) {
|
||||
// if ($count === 1) {
|
||||
if (count($args) == $scalarCount || ($scalarCount == 0 && count($rowData['newObjects'])) {
|
||||
$result[$resultKey] = $obj;
|
||||
|
||||
continue;
|
||||
|
@ -553,7 +553,8 @@ class ObjectHydrator extends AbstractHydrator
|
||||
$args = $newObject['args'];
|
||||
$obj = $class->newInstanceArgs($args);
|
||||
|
||||
if (count($args) == $scalarCount) {
|
||||
// if (count($args) == $scalarCount) {
|
||||
if (count($args) == $scalarCount || ($scalarCount == 0 && count($rowData['newObjects']))) {
|
||||
$result[$resultKey] = $obj;
|
||||
|
||||
continue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user