set a limit on fetchOne queries
This commit is contained in:
parent
872bb1acd5
commit
51f957bcba
1 changed files with 1 additions and 1 deletions
|
@ -157,7 +157,7 @@ class Doctrine_Query extends Doctrine_Query_Abstract
|
||||||
*/
|
*/
|
||||||
public function fetchOne($params = array(), $hydrationMode = null)
|
public function fetchOne($params = array(), $hydrationMode = null)
|
||||||
{
|
{
|
||||||
$collection = $this->execute($params, $hydrationMode);
|
$collection = $this->limit(1)->execute($params, $hydrationMode);
|
||||||
|
|
||||||
if (count($collection) === 0) {
|
if (count($collection) === 0) {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue