private function hasNumericIndex(array
$data): bool
{ return array_keys($data) ===
range(0, \
count($data) - 1
);
} /**
* @param array{sort: list<array{order: string, type: string, field: string}>|string} $payload
*/
private function addSorting(array
$payload, Criteria
$criteria, EntityDefinition
$definition, SearchRequestException
$searchException): void
{ if (\
is_array($payload['sort'
])) { $sorting =
$this->
parseSorting($definition,
$payload['sort'
]);
$criteria->
addSorting(...
$sorting);
return;
} try { $sorting =
$this->
parseSimpleSorting($definition,
$payload['sort'
]);
$criteria->
addSorting(...
$sorting);
} catch (InvalidSortQueryException
$ex) { $searchException->
add($ex, '/sort'
);
} }