Ticket #1380: 1380.diff
| File 1380.diff, 1.7 KB (added by jwage, 19 months ago) |
|---|
-
lib/Doctrine/Hydrator.php
33 33 */ 34 34 class Doctrine_Hydrator extends Doctrine_Hydrator_Abstract 35 35 { 36 protected $_rootAlias = null; 36 37 /** 37 38 * hydrateResultSet 38 39 * parses the data returned by statement object … … 76 77 // Used variables during hydration 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 81 83 $isSimpleQuery = count($this->_queryComponents) <= 1; … … 316 318 $table = $map['table']; 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 323 327 if ($cache[$key]['isIdentifier']) { … … 331 335 $fieldName, $value, $cache[$key]['type']); 332 336 } 333 337 338 // Ticket #1380 339 if ($agg) { 340 $rowData[$this->_rootAlias][$fieldName] = $rowData[$dqlAlias][$fieldName]; 341 } 342 334 343 if ( ! isset($nonemptyComponents[$dqlAlias]) && $value !== null) { 335 344 $nonemptyComponents[$dqlAlias] = true; 336 345 }