Skip to content

IsMainLocation Sort Clause

The Location\IsMainLocation Sort Clause sorts search results by whether their Location is the main Location of the content item.

Locations that are not main Locations are ranked as lower values (e.g. with ascending order they will be returned first).

Arguments

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

Limitations

The Location\IsMainLocation Sort Clause is not available in Repository filtering.

Example

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