throw new CacheableBadRequestHttpException($cacheability, 'You need to provide a value for the sort parameter.'
);
} // Expand a JSON:API compliant sort into a more expressive sort parameter.
if (is_string($parameter)) { $parameter =
static::
expandFieldString($parameter);
} // Expand any defaults into the sort array.
$expanded =
[];
foreach ($parameter as $sort_index =>
$sort_item) { $expanded[$sort_index] =
static::
expandItem($sort_item);
} return new static($expanded);
} /**
* Expands a simple string sort into a more expressive sort that we can use.
*
* @param string $fields
* The comma separated list of fields to expand into an array.
*
* @return array
* The expanded sort.
*/