Skip to content

Commit

Permalink
SimpleQuery: Ignore limit and offset when counting
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Meyer committed May 6, 2015
1 parent 4044e56 commit 16a7b01
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions library/Icinga/Data/SimpleQuery.php
Expand Up @@ -426,13 +426,15 @@ public function fetchPairs()
}

/**
* Count all rows of the result set
* Count all rows of the result set, ignoring limit and offset
*
* @return int
* @return int
*/
public function count()
{
return $this->ds->count($this);
$query = clone $this;
$query->limit(0, 0);
return $this->ds->count($query);
}

/**
Expand Down

0 comments on commit 16a7b01

Please sign in to comment.