cache new object mappings
This commit is contained in:
parent
0fbb78e61a
commit
b29d47a682
@ -237,14 +237,16 @@ abstract class AbstractHydrator
|
||||
|
||||
if (isset ($this->_rsm->newObjectMappings[$key])) {
|
||||
$cache[$key]['isNewObjectParameter'] = true;
|
||||
$cache[$key]['argIndex'] = $this->_rsm->newObjectMappings[$key]['argIndex'];
|
||||
$cache[$key]['objIndex'] = $this->_rsm->newObjectMappings[$key]['objIndex'];
|
||||
$cache[$key]['class'] = new \ReflectionClass($this->_rsm->newObjectMappings[$key]['className']);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset ($cache[$key]['isNewObjectParameter'])) {
|
||||
$argIndex = $this->_rsm->newObjectMappings[$key]['argIndex'];
|
||||
$objIndex = $this->_rsm->newObjectMappings[$key]['objIndex'];
|
||||
$className = $this->_rsm->newObjectMappings[$key]['className'];
|
||||
$rowData['newObjects'][$objIndex]['className'] = $className;
|
||||
$argIndex = $cache[$key]['argIndex'];
|
||||
$objIndex = $cache[$key]['objIndex'];
|
||||
$rowData['newObjects'][$objIndex]['class'] = $cache[$key]['class'];
|
||||
$rowData['newObjects'][$objIndex]['args'][$argIndex] = $cache[$key]['fieldName'];
|
||||
}
|
||||
|
||||
|
@ -551,11 +551,10 @@ class ObjectHydrator extends AbstractHydrator
|
||||
|
||||
foreach ($newObjects as $newObject) {
|
||||
$args = array();
|
||||
$className = $newObject['className'];
|
||||
$class = $newObject['class'];
|
||||
foreach ($newObject['args'] as $index => $name) {
|
||||
$args[$index] = $result[$resultKey][$name];
|
||||
}
|
||||
$class = new \ReflectionClass($className);
|
||||
$result[$resultKey] = $class->newInstanceArgs($args);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user