Neomerx\JsonApi\Http\Query\RestrictiveQueryChecker::checkSorting PHP Метод

checkSorting() защищенный Метод

protected checkSorting ( ErrorCollection $errors, Neomerx\JsonApi\Contracts\Encoder\Parameters\EncodingParametersInterface $parameters )
$errors Neomerx\JsonApi\Exceptions\ErrorCollection
$parameters Neomerx\JsonApi\Contracts\Encoder\Parameters\EncodingParametersInterface
    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()]));
                }
            }
        }
    }