- Fixed GroupBy
This commit is contained in:
1 parent
538af38769
commit
5d00a7e394
6 files changed
+25
-22
No files matched your search
+12
-5
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user