Skip to content

Random Sort Clause

The Random Sort Clause orders search results randomly.

Arguments

  • seed (optional) - int representing the random seed
  • sortDirection (optional) - Query or LocationQuery constant, either Query::SORT_ASC or Query::SORT_DESC.

Example

1
2
$query = new LocationQuery();
$query->sortClauses = [new SortClause\Random()];
Read the Docs