FIX: Doctrine_Query::count() prevented execute() calls on the same query object
This commit is contained in:
parent
32b564e742
commit
44101abceb
@ -376,6 +376,8 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable {
|
|||||||
*/
|
*/
|
||||||
public function count($params = array())
|
public function count($params = array())
|
||||||
{
|
{
|
||||||
|
$parts_old = $this->parts;
|
||||||
|
|
||||||
$this->remove('select');
|
$this->remove('select');
|
||||||
$join = $this->join;
|
$join = $this->join;
|
||||||
$where = $this->where;
|
$where = $this->where;
|
||||||
@ -408,6 +410,7 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable {
|
|||||||
|
|
||||||
$params = array_merge($this->params, $params);
|
$params = array_merge($this->params, $params);
|
||||||
|
|
||||||
|
$this->parts = $parts_old;
|
||||||
return (int) $this->getConnection()->fetchOne($q, $params);
|
return (int) $this->getConnection()->fetchOne($q, $params);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user