change datatable to accept multisort

This commit is contained in:
2024-12-23 07:50:36 +00:00
parent dbbc25ac7b
commit e9ca94f089
2 changed files with 13 additions and 5 deletions

View File

@@ -57,12 +57,17 @@ class DataTableInput
}
/**
* @return Sort|null
* @return array|null
*/
public function getSorting(): ?Sort
public function getSorting(): ?array
{
return !empty($this->sorting) ?
new Sort($this->sorting[0]->id, $this->sorting[0]->desc, $this->allowedSortings) : null;
$sorts = [];
if (!empty($this->sorting)){
foreach ($this->sorting as $sort) {
$sorts[] = new Sort($sort->id, $sort->desc, $this->allowedSortings);
}
}
return $sorts == [] ? null : $sorts;
}
public function getRelations(): array