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

count() fixed

This commit is contained in:
zYne 2006-09-17 18:49:45 +00:00
parent 1b0d2c78b2
commit bb2a1312ed

View File

@ -44,7 +44,7 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable {
private $relationStack = array();
private $distinct;
private $isDistinct = false;
/**
* create
* returns a new Doctrine_Query object
@ -80,7 +80,7 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable {
$where = $this->where;
$having = $this->having;
$q = "SELECT COUNT(1) FROM ".$table->getTableName()." ";
$q = "SELECT COUNT(DISTINCT ".$table->getTableName().'.'.$table->getIdentifier().") FROM ".$table->getTableName()." ";
foreach($join as $j) {
$q .= implode(" ",$j);
}