createSortParam() public méthode

Create sort parameter.
public createSortParam ( string $sortField, boolean $isAscending ) : Neomerx\JsonApi\Contracts\Encoder\Parameters\SortParameterInterface
$sortField string
$isAscending boolean
Résultat Neomerx\JsonApi\Contracts\Encoder\Parameters\SortParameterInterface
 /**
  * @param array $parameters
  *
  * @return SortParameterInterface[]|null
  */
 protected function getSortParameters(array $parameters)
 {
     $sortParams = null;
     $sortParam = $this->getStringParamOrNull($parameters, self::PARAM_SORT);
     if ($sortParam !== null) {
         foreach (explode(',', $sortParam) as $param) {
             $isDesc = false;
             empty($param) === false ? $isDesc = $param[0] === '-' : E::throwException(new E([], E::HTTP_CODE_BAD_REQUEST));
             $sortField = ltrim($param, '+-');
             empty($sortField) === false ?: E::throwException(new E([], E::HTTP_CODE_BAD_REQUEST));
             $sortParams[] = $this->factory->createSortParam($sortField, $isDesc === false);
         }
     }
     return $sortParams;
 }