Skip to content

DatePublished Sort Clause

The DatePublished Sort Clause sorts search results by the date and time of the first publication of a Content item.

Arguments

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

Example

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