Commit 330bf1d4 authored by zYne's avatar zYne

--no commit message

--no commit message
parent f26217c8
...@@ -398,8 +398,12 @@ class Doctrine_Hydrate ...@@ -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 ...@@ -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 ...@@ -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'); ...@@ -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
......
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