Commit 3b48b791 authored by zYne's avatar zYne

--no commit message

--no commit message
parent e81891e3
...@@ -60,14 +60,16 @@ class Doctrine_Query_Having extends Doctrine_Query_Condition ...@@ -60,14 +60,16 @@ class Doctrine_Query_Having extends Doctrine_Query_Condition
} else { } else {
if ( ! is_numeric($func)) { if ( ! is_numeric($func)) {
$a = explode('.', $func); $a = explode('.', $func);
$field = array_pop($a);
if (count($a) > 1) { if (count($a) > 1) {
$field = array_pop($a);
$reference = implode('.', $a); $reference = implode('.', $a);
$table = $this->query->load($reference, false); $table = $this->query->load($reference, false);
$field = $table->getColumnName($field); $field = $table->getColumnName($field);
$func = $this->query->getTableAlias($reference) . '.' . $field; $func = $this->query->getTableAlias($reference) . '.' . $field;
} else { } else {
$func = $this->query->getAggregateAlias($field); $field = end($a);
$func = $this->query->getAggregateAlias($field);
} }
return $func; return $func;
} else { } else {
......
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