Skip to content

Commit

Permalink
Revert "Fix(Query): column added twice with custom aliases"
Browse files Browse the repository at this point in the history
This reverts commit 1d68711.
  • Loading branch information
alquerci committed Apr 15, 2024
1 parent e089921 commit 7632657
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 26 deletions.
6 changes: 0 additions & 6 deletions lib/Doctrine/Hydrator/Graph.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,17 +311,11 @@ protected function _gatherRowData(&$data, &$cache, &$id, &$nonemptyComponents)
$table = $this->_queryComponents[$cache[$key]['dqlAlias']]['table'];
$fieldName = $table->getFieldName($last);
$cache[$key]['fieldName'] = $fieldName;

if (isset($this->_queryComponents[$cache[$key]['dqlAlias']]['agg_field'][$last])) {
$fieldName = $this->_queryComponents[$cache[$key]['dqlAlias']]['agg_field'][$last];
}

if ($table->isIdentifier($fieldName)) {
$cache[$key]['isIdentifier'] = true;
} else {
$cache[$key]['isIdentifier'] = false;
}

$type = $table->getTypeOfColumn($last);
if ($type == 'integer' || $type == 'string') {
$cache[$key]['isSimpleType'] = true;
Expand Down
4 changes: 0 additions & 4 deletions lib/Doctrine/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -648,10 +648,6 @@ public function parseSelect($dql)

$this->_queryComponents[$componentAlias]['agg'][$index] = $alias;

if (preg_match('/^([^\(]+)\.(\'?)(.*?)(\'?)$/', $expression, $field)) {
$this->_queryComponents[$componentAlias]['agg_field'][$index] = $field[3];
}

$this->_neededTables[] = $tableAlias;
} else {
$e = explode('.', $terms[0]);
Expand Down
16 changes: 0 additions & 16 deletions lib/Doctrine/Query/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,16 +206,6 @@ abstract class Doctrine_Query_Abstract
*
* map the name of the column / aggregate value this
* component is mapped to a collection
*
* agg_field the field names for each aggregates
* Example:
* DQL: COMPONENT.FIELD as ALIAS
* SQL: TABLE.COLUMN as TABLE__0
* $_queryComponents
* agg:
* 0: ALIAS
* agg_field:
* 0: FIELD
*/
protected $_queryComponents = array();

Expand Down Expand Up @@ -1269,9 +1259,6 @@ protected function _constructQueryFromCache($cached)
if (isset($components['agg'])) {
$queryComponents[$alias]['agg'] = $components['agg'];
}
if (isset($components['agg_field'])) {
$queryComponents[$alias]['agg_field'] = $components['agg_field'];
}
if (isset($components['map'])) {
$queryComponents[$alias]['map'] = $components['map'];
}
Expand Down Expand Up @@ -1302,9 +1289,6 @@ public function getCachedForm($customComponent = null)
if (isset($components['agg'])) {
$componentInfo[$alias]['agg'] = $components['agg'];
}
if (isset($components['agg_field'])) {
$componentInfo[$alias]['agg_field'] = $components['agg_field'];
}
if (isset($components['map'])) {
$componentInfo[$alias]['map'] = $components['map'];
}
Expand Down

0 comments on commit 7632657

Please sign in to comment.