1
0
mirror of synced 2024-12-14 15:16:04 +03:00
This commit is contained in:
zYne 2007-05-16 19:52:06 +00:00
parent f26217c87a
commit 330bf1d408
2 changed files with 14 additions and 2 deletions

View File

@ -398,8 +398,12 @@ class Doctrine_Hydrate
reset($this->_aliasMap);
$rootMap = current($this->_aliasMap);
$rootAlias = key($this->_aliasMap);
$coll = new Doctrine_Collection2($rootMap['table']);
$coll = new Doctrine_Collection($rootMap['table']);
$prev[$rootAlias] = $coll;
// we keep track of all the collections
$colls = array();
$colls[] = $coll;
$prevRow = array();
/**
@ -471,6 +475,9 @@ class Doctrine_Hydrate
// previous entry found from memory
$prev[$alias] = $prev[$parentAlias]->getLast()->get($relation->getAlias());
}
$colls[] = $prev[$alias];
// add record to the current collection
if ($identifiable) {
$prev[$alias]->add($record);
@ -491,6 +498,11 @@ class Doctrine_Hydrate
$prevRow[$tableAlias] = $row;
}
}
// take snapshots from all initialized collections
foreach(array_unique($colls) as $coll) {
$coll->takeSnapshot();
}
return $coll;
}
/**

View File

@ -30,7 +30,7 @@ Doctrine::autoload('Doctrine_Hydrate');
* @version $Revision$
* @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