Skip to content
For AI agents: the complete documentation index is available at llms.txt; this page is also available as Markdown at index.md.

DatePublished Sort Clause

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

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\DatePublished()];