Changeset 4993
- Timestamp:
- 09/26/08 21:14:01 (3 months ago)
- Files:
-
- 1 modified
-
branches/1.0/lib/Doctrine/Hydrator.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.0/lib/Doctrine/Hydrator.php
r4831 r4993 34 34 class Doctrine_Hydrator extends Doctrine_Hydrator_Abstract 35 35 { 36 protected $_rootAlias = null; 36 37 /** 37 38 * hydrateResultSet … … 77 78 reset($this->_queryComponents); 78 79 $rootAlias = key($this->_queryComponents); 80 $this->_rootAlias = $rootAlias; 79 81 $rootComponentName = $this->_queryComponents[$rootAlias]['table']->getComponentName(); 80 82 // if only one component is involved we can make our lives easier … … 317 319 $dqlAlias = $cache[$key]['dqlAlias']; 318 320 $fieldName = $cache[$key]['fieldName']; 321 $agg = false; 319 322 if (isset($this->_queryComponents[$dqlAlias]['agg'][$fieldName])) { 320 323 $fieldName = $this->_queryComponents[$dqlAlias]['agg'][$fieldName]; 324 $agg = true; 321 325 } 322 326 … … 330 334 $rowData[$dqlAlias][$fieldName] = $table->prepareValue( 331 335 $fieldName, $value, $cache[$key]['type']); 336 } 337 338 // Ticket #1380 339 // Hydrate aggregates in to the root component as well. 340 // So we know that all aggregate values will always be available in the root component 341 if ($agg) { 342 $rowData[$this->_rootAlias][$fieldName] = $rowData[$dqlAlias][$fieldName]; 332 343 } 333 344