Commit 7e953aa2 authored by zYne's avatar zYne

subquery aliases now mapped to aliasMap

parent 074a434a
......@@ -81,16 +81,14 @@ class Doctrine_Hydrate
* relation the relation object owned by the parent
*
* parent the alias of the parent
*
* subAgg the subquery aggregates of this component
*/
protected $_aliasMap = array();
/**
*
*/
protected $pendingAggregates = array();
/**
*
*/
protected $subqueryAggregates = array();
/**
* @var array $aggregateMap an array containing all aggregate aliases, keys as dql aliases
* and values as sql aliases
......@@ -335,8 +333,8 @@ class Doctrine_Hydrate
if (isset($this->pendingAggregates[$alias][$index])) {
$agg = $this->pendingAggregates[$alias][$index][3];
} elseif (isset($this->subqueryAggregates[$alias][$index])) {
$agg = $this->subqueryAggregates[$alias][$index];
} elseif (isset($this->_aliasMap[$alias]['subAgg'][$index])) {
$agg = $this->_aliasMap[$alias]['subAgg'][$index];
}
$record->mapValue($agg, $value);
$found = true;
......
......@@ -32,9 +32,6 @@ Doctrine::autoload('Doctrine_Query_Abstract');
*/
class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
{
/**
* @param array $subqueryAliases the table aliases needed in some LIMIT subqueries
*/
protected $subqueryAliases = array();
/**
* @param boolean $needsSubquery
......@@ -441,7 +438,7 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
$this->parts['select'][] = '(' . $sql . ') AS ' . $sqlAlias;
$this->aggregateMap[$alias] = $sqlAlias;
$this->subqueryAggregates[$componentAlias][] = $alias;
$this->_aliasMap[$componentAlias]['subAgg'][] = $alias;
}
$this->pendingSubqueries = array();
}
......
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