From 5b0858cfb9c17a5c6ec45f739d4dd89fd49fdc82 Mon Sep 17 00:00:00 2001 From: zYne Date: Fri, 25 Aug 2006 21:20:44 +0000 Subject: [PATCH] Query count() fix --- Doctrine/Query.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doctrine/Query.php b/Doctrine/Query.php index d1cf99cc7..ac01b0db6 100644 --- a/Doctrine/Query.php +++ b/Doctrine/Query.php @@ -26,7 +26,7 @@ require_once("Hydrate.php"); * @url www.phpdoctrine.com * @license LGPL */ -class Doctrine_Query extends Doctrine_Hydrate { +class Doctrine_Query extends Doctrine_Hydrate implements Countable { /** * @param array $subqueryAliases the table aliases needed in some LIMIT subqueries */ @@ -50,7 +50,7 @@ class Doctrine_Query extends Doctrine_Hydrate { $where = $this->where; $having = $this->having; - $q = "SELECT COUNT(1) FROM ".$table->getComponentName()." "; + $q = "SELECT COUNT(1) FROM ".$table->getTableName()." "; foreach($join as $j) { $q .= implode(" ",$j); }