Commit bb2a1312 authored by zYne's avatar zYne

count() fixed

parent 1b0d2c78
...@@ -44,7 +44,7 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable { ...@@ -44,7 +44,7 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable {
private $relationStack = array(); private $relationStack = array();
private $distinct; private $isDistinct = false;
/** /**
* create * create
* returns a new Doctrine_Query object * returns a new Doctrine_Query object
...@@ -80,7 +80,7 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable { ...@@ -80,7 +80,7 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable {
$where = $this->where; $where = $this->where;
$having = $this->having; $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) { 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