mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 16:14:40 +00:00
mvc, add missing default sort field name in ApiMutableModelControllerBase
This commit is contained in:
parent
80506b66b3
commit
cd6b733ac0
@ -213,10 +213,11 @@ abstract class ApiMutableModelControllerBase extends ApiControllerBase
|
||||
* Model search wrapper
|
||||
* @param string $path path to search, relative to this model
|
||||
* @param array $fields fieldnames to fetch in result
|
||||
* @param string|null $defaultSort default sort field name
|
||||
* @return array
|
||||
* @throws \ReflectionException when binding to the model class fails
|
||||
*/
|
||||
public function searchBase($path, $fields)
|
||||
public function searchBase($path, $fields, $defaultSort=null)
|
||||
{
|
||||
$element = $this->getModel();
|
||||
foreach (explode('.', $path) as $step) {
|
||||
@ -225,7 +226,8 @@ abstract class ApiMutableModelControllerBase extends ApiControllerBase
|
||||
$grid = new UIModelGrid($element);
|
||||
return $grid->fetchBindRequest(
|
||||
$this->request,
|
||||
$fields
|
||||
$fields,
|
||||
$defaultSort
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user