This commit is contained in:
parent
f26217c87a
commit
330bf1d408
2 changed files with 14 additions and 2 deletions
|
@ -398,8 +398,12 @@ class Doctrine_Hydrate
|
||||||
reset($this->_aliasMap);
|
reset($this->_aliasMap);
|
||||||
$rootMap = current($this->_aliasMap);
|
$rootMap = current($this->_aliasMap);
|
||||||
$rootAlias = key($this->_aliasMap);
|
$rootAlias = key($this->_aliasMap);
|
||||||
$coll = new Doctrine_Collection2($rootMap['table']);
|
$coll = new Doctrine_Collection($rootMap['table']);
|
||||||
$prev[$rootAlias] = $coll;
|
$prev[$rootAlias] = $coll;
|
||||||
|
|
||||||
|
// we keep track of all the collections
|
||||||
|
$colls = array();
|
||||||
|
$colls[] = $coll;
|
||||||
|
|
||||||
$prevRow = array();
|
$prevRow = array();
|
||||||
/**
|
/**
|
||||||
|
@ -471,6 +475,9 @@ class Doctrine_Hydrate
|
||||||
// previous entry found from memory
|
// previous entry found from memory
|
||||||
$prev[$alias] = $prev[$parentAlias]->getLast()->get($relation->getAlias());
|
$prev[$alias] = $prev[$parentAlias]->getLast()->get($relation->getAlias());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$colls[] = $prev[$alias];
|
||||||
|
|
||||||
// add record to the current collection
|
// add record to the current collection
|
||||||
if ($identifiable) {
|
if ($identifiable) {
|
||||||
$prev[$alias]->add($record);
|
$prev[$alias]->add($record);
|
||||||
|
@ -491,6 +498,11 @@ class Doctrine_Hydrate
|
||||||
$prevRow[$tableAlias] = $row;
|
$prevRow[$tableAlias] = $row;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// take snapshots from all initialized collections
|
||||||
|
foreach(array_unique($colls) as $coll) {
|
||||||
|
$coll->takeSnapshot();
|
||||||
|
}
|
||||||
|
|
||||||
return $coll;
|
return $coll;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -30,7 +30,7 @@ Doctrine::autoload('Doctrine_Hydrate');
|
||||||
* @version $Revision$
|
* @version $Revision$
|
||||||
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||||||
*/
|
*/
|
||||||
class Doctrine_Query extends Doctrine_Hydrate2 implements Countable
|
class Doctrine_Query extends Doctrine_Hydrate implements Countable
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param array $subqueryAliases the table aliases needed in some LIMIT subqueries
|
* @param array $subqueryAliases the table aliases needed in some LIMIT subqueries
|
||||||
|
|
Loading…
Add table
Reference in a new issue