Neomerx\JsonApi\Contracts\Encoder\Parameters\EncodingParametersInterface::getSortParameters PHP Метод

getSortParameters() публичный Метод

Get sort parameters.
public getSortParameters ( ) : Neomerx\JsonApi\Contracts\Encoder\Parameters\SortParameterInterface[] | null
Результат Neomerx\JsonApi\Contracts\Encoder\Parameters\SortParameterInterface[] | null
    public function getSortParameters();

Usage Example

Пример #1
0
 /**
  * @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()]));
             }
         }
     }
 }
All Usage Examples Of Neomerx\JsonApi\Contracts\Encoder\Parameters\EncodingParametersInterface::getSortParameters