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 aren't main locations are ranked as lower values (for example, with ascending order they're returned first).

Arguments

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

Limitations

The Location\IsMainLocation Sort Clause isn't available in Repository filtering.

Example

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