From 16a7b010bcf34988f61ae85bf39a5e0a0b2100c8 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 6 May 2015 10:41:39 +0200 Subject: [PATCH] SimpleQuery: Ignore limit and offset when counting --- library/Icinga/Data/SimpleQuery.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/library/Icinga/Data/SimpleQuery.php b/library/Icinga/Data/SimpleQuery.php index 3477c2331..875f5222a 100644 --- a/library/Icinga/Data/SimpleQuery.php +++ b/library/Icinga/Data/SimpleQuery.php @@ -426,13 +426,15 @@ class SimpleQuery implements QueryInterface } /** - * 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); } /**