Commit baf77264 authored by romanb's avatar romanb

Hydrator speed improvement

parent fc310cf3
...@@ -289,8 +289,12 @@ class Doctrine_Hydrator extends Doctrine_Hydrator_Abstract ...@@ -289,8 +289,12 @@ class Doctrine_Hydrator extends Doctrine_Hydrator_Abstract
$e = explode('__', $key); $e = explode('__', $key);
$last = strtolower(array_pop($e)); $last = strtolower(array_pop($e));
$cache[$key]['dqlAlias'] = $this->_tableAliases[strtolower(implode('__', $e))]; $cache[$key]['dqlAlias'] = $this->_tableAliases[strtolower(implode('__', $e))];
$fieldName = $this->_queryComponents[$cache[$key]['dqlAlias']]['table']->getFieldName($last); $table = $this->_queryComponents[$cache[$key]['dqlAlias']]['table'];
$fieldName = $table->getFieldName($last);
$cache[$key]['fieldName'] = $fieldName; $cache[$key]['fieldName'] = $fieldName;
if ($table->isIdentifier($fieldName)) {
$cache[$key]['isIdentifier'] = true;
}
} }
$map = $this->_queryComponents[$cache[$key]['dqlAlias']]; $map = $this->_queryComponents[$cache[$key]['dqlAlias']];
...@@ -302,7 +306,7 @@ class Doctrine_Hydrator extends Doctrine_Hydrator_Abstract ...@@ -302,7 +306,7 @@ class Doctrine_Hydrator extends Doctrine_Hydrator_Abstract
$fieldName = $this->_queryComponents[$dqlAlias]['agg'][$fieldName]; $fieldName = $this->_queryComponents[$dqlAlias]['agg'][$fieldName];
} }
if ($table->isIdentifier($fieldName)) { if (isset($cache[$key]['isIdentifier'])) {
$id[$dqlAlias] .= '|' . $value; $id[$dqlAlias] .= '|' . $value;
} }
......
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