lib/Collection/QueryType/Handler/Traits/SortTrait.php
private function getSortClauses(ParameterCollectionInterface $parameterCollection, ?Location $parentLocation = null): array
    {
        $sortType = $parameterCollection->getParameter('sort_type')->getValue() ?? 'default';
        $sortDirection = $parameterCollection->getParameter('sort_direction')->getValue() ?? LocationQuery::SORT_DESC;

        if ($sortType === 'defined_by_parent' && $parentLocation !== null) {
            return $parentLocation->getSortClauses();
        }

        return [
            new self::$sortClauses[$sortType]($sortDirection),
        ];
    }
private function getSortClauses(ParameterCollectionInterface $parameterCollection, ?Location $parentLocation = null): array
    {
        $sortType = $parameterCollection->getParameter('sort_type')->getValue() ?? 'default';
        $sortDirection = $parameterCollection->getParameter('sort_direction')->getValue() ?? LocationQuery::SORT_DESC;

        if ($sortType === 'defined_by_parent' && $parentLocation !== null) {
            return $parentLocation->getSortClauses();
        }

        return [
            new self::$sortClauses[$sortType]($sortDirection),
        ];
    }
private function getSortClauses ( ParameterCollectionInterface $ parameterCollection , ? Location $ parentLocation = null ) : array { $ sortType = $ parameterCollection -> getParameter ( 'sort_type' ) -> getValue ( ) ?? 'default' ; $ sortDirection = $ parameterCollection -> getParameter ( 'sort_direction' ) -> getValue ( ) ?? LocationQuery :: SORT_DESC ; if ( $ sortType === 'defined_by_parent' && $ parentLocation !== null ) { return $ parentLocation -> getSortClauses ( ) ; } return [ new self :: $ sortClauses [ $ sortType ] ( $ sortDirection ) , ] ; }
Returns the clauses for sorting eZ content.

@return \eZ\Publish\API\Repository\Values\Content\Query\SortClause[]
Returns the clauses for sorting eZ content .