Permalink
Browse files

FIX: Add missing 'groupby' and remove redundant conditional in 'having'

  • Loading branch information...
1 parent bd91891 commit 32905111419b739ce5170127410d77c2964668df @nedmas nedmas committed with root May 29, 2013
Showing with 11 additions and 3 deletions.
  1. +11 −3 model/DataQuery.php
View
@@ -419,14 +419,22 @@ protected function selectColumnsFromTable(SQLQuery &$query, $tableClass, $column
}
/**
+ * 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;
}

0 comments on commit 3290511

Please sign in to comment.