This documentation is for a version that has reached its End Of Life. Such versions are no longer supported and don't receive security updates. Consider updating to a newer version.
Discounts Search Sort Clauses reference¶
Sort Clauses are found in the Ibexa\Contracts\Discounts\Value\Query\SortClause
namespace, implementing the SortClauseInterface interface:
Name | Description |
---|---|
CreatedAt | Sort by discount's creation date |
EndDate | Sort by discount's end date |
Id | Sort by discount's database ID |
Identifier | Sort by discount identifier |
Priority | Sort by discount priority |
StartDate | Sort by discount start date |
Type | Sort by the place where the discount activates: catalog or cart. When sorting with ascending order, cart discounts are returned first. |
UpdatedAt | Sort by discount modification date |
The following example shows how to use them to sort the searched discounts:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|
The returned active discounts are sorted by:
- the place where they activate: catalog or cart, with
cart
discounts returned first - priority (descending)
- creation date (descending)
You can change the default sorting order by using the SORT_ASC
and SORT_DESC
constants from AbstractSortClause
.