- First draft of current WIP
This commit is contained in:
commit
b73d046e0a
47 files changed
+2797
No files matched your search
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Ulmus\Query;
|
||||
|
||||
class GroupBy extends Fragment {
|
||||
public int $order = 70;
|
||||
|
||||
public array $groupBy = [];
|
||||
|
||||
public function set(array $order) : self
|
||||
{
|
||||
$this->groupBy = $order;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function add(string $field, ? string $direction = null) : self
|
||||
{
|
||||
$this->groupBy[] = $field;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function render() : string
|
||||
{
|
||||
return $this->renderSegments([
|
||||
'GROUP BY', implode(", ", $this->groupBy)
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user