Skip to content

Depth Sort Clause

The Location\Depth Sort Clause sorts search results by the depth of the location in the content tree.

Arguments

  • (optional) sortDirection - Query or LocationQuery constant, either Query::SORT_ASC or Query::SORT_DESC

Example

1
2
3
4
5
use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery;
use Ibexa\Contracts\Core\Repository\Values\Content\Query\SortClause;

$query = new LocationQuery();
$query->sortClauses = [new SortClause\Location\Depth()];