- Still WIP on Api's wrapper

This commit is contained in:
Dave Mc Nicoll committed 2023-10-27 18:33:48 -04:00
1 parent 1927b43999
commit 8e0dce3e71
6 files changed
+26 -6

No files matched your search

+8 -2
View File
@@ -532,7 +532,7 @@ class Repository
return $this;
}
public function orderBy(string|\Stringable $field, ? string $direction = null) : self
public function orderBy(string|object $field, ? string $direction = null) : self
{
$this->queryBuilder->orderBy($field, $direction);
@@ -550,7 +550,13 @@ class Repository
public function orders(array $orderList) : self
{
foreach($orderList as $field => $direction) {
$this->orderBy($field, $direction);
if (is_numeric($field)) {
$this->orderBy($direction);
}
else {
# Associative array with direction
$this->orderBy($field, $direction);
}
}
return $this;