Commit 5b0858cf authored by zYne's avatar zYne

Query count() fix

parent cfa6a512
...@@ -26,7 +26,7 @@ require_once("Hydrate.php"); ...@@ -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 { ...@@ -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);
} }
......
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