getSortParameters() public method

Get sort parameters.
public getSortParameters ( ) : Neomerx\JsonApi\Contracts\Encoder\Parameters\SortParameterInterface[] | null
return Neomerx\JsonApi\Contracts\Encoder\Parameters\SortParameterInterface[] | null
 /**
  * @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()]));
             }
         }
     }
 }
 /**
  * @param ErrorCollection             $errors
  * @param EncodingParametersInterface $parameters
  *
  * @return array
  */
 public function mapParameters(ErrorCollection $errors, EncodingParametersInterface $parameters)
 {
     $filters = $this->mapFilterParameters($errors, $parameters->getFilteringParameters());
     $sorts = $this->mapSortParameters($errors, $parameters->getSortParameters());
     $includes = $this->mapIncludeParameters($errors, $parameters->getIncludePaths());
     $paging = $parameters->getPaginationParameters();
     return [$filters, $sorts, $includes, $paging];
 }
 /**
  * @inheritdoc
  */
 public function search(Builder $builder, EncodingParametersInterface $parameters)
 {
     $filters = new Collection((array) $parameters->getFilteringParameters());
     if ($this->isFindMany($filters)) {
         return $this->findMany($builder, $filters);
     }
     $this->filter($builder, $filters);
     $this->sort($builder, (array) $parameters->getSortParameters());
     if ($this->isSearchOne($filters)) {
         return $this->first($builder);
     }
     return $this->isPaginated() ? $this->paginate($builder) : $this->all($builder);
 }