1
0
mirror of synced 2025-01-18 06:21:40 +03:00

Query count() fix

This commit is contained in:
zYne 2006-08-25 21:20:44 +00:00
parent cfa6a512f3
commit 5b0858cfb9

View File

@ -26,7 +26,7 @@ require_once("Hydrate.php");
* @url www.phpdoctrine.com * @url www.phpdoctrine.com
* @license LGPL * @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 * @param array $subqueryAliases the table aliases needed in some LIMIT subqueries
*/ */
@ -50,7 +50,7 @@ class Doctrine_Query extends Doctrine_Hydrate {
$where = $this->where; $where = $this->where;
$having = $this->having; $having = $this->having;
$q = "SELECT COUNT(1) FROM ".$table->getComponentName()." "; $q = "SELECT COUNT(1) FROM ".$table->getTableName()." ";
foreach($join as $j) { foreach($join as $j) {
$q .= implode(" ",$j); $q .= implode(" ",$j);
} }