- Fixed GroupBy

This commit is contained in:
Dave Mc Nicoll committed 2020-10-06 11:43:31 -04:00
1 parent 538af38769
commit 5d00a7e394
6 files changed
+25 -22

No files matched your search

+12 -5
View File
@@ -216,11 +216,6 @@ class QueryBuilder
return $this->where($field, $value, $operator, true);
}
public function groupBy() : self
{
return $this;
}
public function limit(int $value) : self
{
if ( null === $limit = $this->getFragment(Query\Limit::class) ) {
@@ -257,6 +252,18 @@ class QueryBuilder
return $this;
}
public function groupBy(string $field, ? string $direction = null) : self
{
if ( null === $groupBy = $this->getFragment(Query\GroupBy::class) ) {
$groupBy = new Query\GroupBy();
$this->push($groupBy);
}
$groupBy->add($field, $direction);
return $this;
}
public function join(string $type, /*string | QueryBuilder*/ $table, $field, $value, bool $outer = false, ? string $alias = null) : self
{
$join = new Query\Join($this);