From 32905111419b739ce5170127410d77c2964668df Mon Sep 17 00:00:00 2001 From: Tom Densham Date: Wed, 29 May 2013 16:58:32 +0200 Subject: [PATCH] FIX: Add missing 'groupby' and remove redundant conditional in 'having' --- model/DataQuery.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/model/DataQuery.php b/model/DataQuery.php index 4270f3597..7d808fe95 100644 --- a/model/DataQuery.php +++ b/model/DataQuery.php @@ -418,15 +418,23 @@ class DataQuery { } } + /** + * Set the GROUP BY clause of this query. + * + * @param String $groupby Escaped SQL statement + */ + public function groupby($groupby) { + $this->query->addGroupBy($groupby); + return $this; + } + /** * Set the HAVING clause of this query. * * @param String $having Escaped SQL statement */ public function having($having) { - if($having) { - $this->query->addHaving($having); - } + $this->query->addHaving($having); return $this; }