/**
* @param ErrorCollection $errors
* @param EncodingParametersInterface $parameters
*/
protected function checkSorting(ErrorCollection $errors, EncodingParametersInterface $parameters)
{
if ($parameters->getSortParameters() !== null && $this->sortParameters !== null) {
foreach ($parameters->getSortParameters() as $sortParameter) {
/** @var SortParameterInterface $sortParameter */
if (array_key_exists($sortParameter->getField(), $this->sortParameters) === false) {
$errors->addQueryParameterError(QP::PARAM_SORT, T::t('Sort parameter %s is not allowed.', [$sortParameter->getField()]));
}
}
}
}