Compare commits

...

2 Commits

Author SHA1 Message Date
Dave Mc Nicoll
27d5fd0b08 Merge branch 'master' of https://git.mcnd.ca/mcndave/ulmus 2020-10-06 11:46:00 -04:00
Dave Mc Nicoll
5d00a7e394 - Fixed GroupBy 2020-10-06 11:43:31 -04:00

View File

@ -217,18 +217,6 @@ 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 limit(int $value) : self
{
if ( null === $limit = $this->getFragment(Query\Limit::class) ) {
@ -265,6 +253,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
{
$this->withJoin(...func_get_args());