Commit 234253ed authored by romanb's avatar romanb

Perf. improvement on hydrating joined resultsets, part 2.

parent 3d8a37b2
...@@ -180,8 +180,6 @@ class Doctrine_Hydrator extends Doctrine_Hydrator_Abstract ...@@ -180,8 +180,6 @@ class Doctrine_Hydrator extends Doctrine_Hydrator_Abstract
$listeners[$componentName]->preHydrate($event); $listeners[$componentName]->preHydrate($event);
//-- //--
$element = $driver->getElement($data, $componentName);
$parent = $map['parent']; $parent = $map['parent'];
$relation = $map['relation']; $relation = $map['relation'];
$relationAlias = $map['relation']->getAlias(); $relationAlias = $map['relation']->getAlias();
...@@ -198,6 +196,7 @@ class Doctrine_Hydrator extends Doctrine_Hydrator_Abstract ...@@ -198,6 +196,7 @@ class Doctrine_Hydrator extends Doctrine_Hydrator_Abstract
// append element // append element
if (isset($nonemptyComponents[$dqlAlias])) { if (isset($nonemptyComponents[$dqlAlias])) {
if ( ! isset($identifierMap[$path][$id[$parent]][$id[$dqlAlias]])) { if ( ! isset($identifierMap[$path][$id[$parent]][$id[$dqlAlias]])) {
$element = $driver->getElement($data, $componentName);
// just event stuff // just event stuff
$event->set('data', $element); $event->set('data', $element);
$listeners[$componentName]->postHydrate($event); $listeners[$componentName]->postHydrate($event);
...@@ -228,6 +227,7 @@ class Doctrine_Hydrator extends Doctrine_Hydrator_Abstract ...@@ -228,6 +227,7 @@ class Doctrine_Hydrator extends Doctrine_Hydrator_Abstract
if ( ! isset($nonemptyComponents[$dqlAlias])) { if ( ! isset($nonemptyComponents[$dqlAlias])) {
$prev[$parent][$relationAlias] = $driver->getNullPointer(); $prev[$parent][$relationAlias] = $driver->getNullPointer();
} else { } else {
$element = $driver->getElement($data, $componentName);
$prev[$parent][$relationAlias] = $element; $prev[$parent][$relationAlias] = $element;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment