From 92a6699e9a8112a37d287640b2fc533be5d239fb Mon Sep 17 00:00:00 2001 From: zYne Date: Tue, 24 Apr 2007 10:15:17 +0000 Subject: [PATCH] --- lib/Doctrine/Query/Having.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/Doctrine/Query/Having.php b/lib/Doctrine/Query/Having.php index 8e8d5c4a7..32b082b00 100644 --- a/lib/Doctrine/Query/Having.php +++ b/lib/Doctrine/Query/Having.php @@ -61,11 +61,14 @@ class Doctrine_Query_Having extends Doctrine_Query_Condition if ( ! is_numeric($func)) { $a = explode('.', $func); $field = array_pop($a); - $reference = implode('.', $a); - $table = $this->query->load($reference, false); - $field = $table->getColumnName($field); - $func = $this->query->getTableAlias($reference) . '.' . $field; - + if (count($a) > 1) { + $reference = implode('.', $a); + $table = $this->query->load($reference, false); + $field = $table->getColumnName($field); + $func = $this->query->getTableAlias($reference) . '.' . $field; + } else { + $func = $this->query->getAggregateAlias($field); + } return $func; } else { return $func;