removing orphaned scalar results and allowing mixed results when use new object expressions
This commit is contained in:
parent
85eac7200d
commit
da7e4ed8de
@ -272,8 +272,6 @@ abstract class AbstractHydrator
|
|||||||
|
|
||||||
$rowData['newObjects'][$objIndex]['class'] = $cacheKeyInfo['class'];
|
$rowData['newObjects'][$objIndex]['class'] = $cacheKeyInfo['class'];
|
||||||
$rowData['newObjects'][$objIndex]['args'][$argIndex] = $value;
|
$rowData['newObjects'][$objIndex]['args'][$argIndex] = $value;
|
||||||
|
|
||||||
$rowData['scalars'][$fieldName] = $value;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case (isset($cacheKeyInfo['isScalar'])):
|
case (isset($cacheKeyInfo['isScalar'])):
|
||||||
|
@ -545,14 +545,15 @@ class ObjectHydrator extends AbstractHydrator
|
|||||||
$resultKey = $this->resultCounter - 1;
|
$resultKey = $this->resultCounter - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$count = count($rowData['newObjects']);
|
|
||||||
|
$scalarCount = count($rowData['scalars']);
|
||||||
|
|
||||||
foreach ($rowData['newObjects'] as $objIndex => $newObject) {
|
foreach ($rowData['newObjects'] as $objIndex => $newObject) {
|
||||||
$class = $newObject['class'];
|
$class = $newObject['class'];
|
||||||
$args = $newObject['args'];
|
$args = $newObject['args'];
|
||||||
$obj = $class->newInstanceArgs($args);
|
$obj = $class->newInstanceArgs($args);
|
||||||
|
|
||||||
if ($count === 1) {
|
if (count($args) == $scalarCount) {
|
||||||
$result[$resultKey] = $obj;
|
$result[$resultKey] = $obj;
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user