Skip to content

Shopping list search criteria reference

The criteria are in the Ibexa\Contracts\ShoppingList\ShoppingList\Query\Criterion namespace and implement the Ibexa\Contracts\ShoppingList\Value\Query\CriterionInterface interface.

Criterion Description
IsDefaultCriterion Find shopping lists that are (or are not) the default one.
NameCriterion Find shopping lists with a name containing the given string.
OwnerCriterion Find shopping lists belonging to the given user or one of the given users.
CreatedAtCriterion Find shopping lists created before or after a given date.
UpdatedAtCriterion Find shopping lists updated before or after a given date.
ProductCodeCriterion Find shopping lists containing an entry with the given product code.
LogicalAnd Combine the criteria passed as arguments.

The following query example gets all shopping lists if current user doesn't have any limitation, or get all current user's lists if there is the ShoppingListOwner self limitation:

1
$query = new ShoppingListQuery();

The following query example gets current user's shopping lists, except the default one, and sorted by name:

1
2
3
4
$query = new ShoppingListQuery(new Query\Criterion\LogicalAnd(
    new Query\Criterion\OwnerCriterion($this->permissionResolver->getCurrentUserReference()),
    new Query\Criterion\IsDefaultCriterion(false)
), [new Query\SortClause\Name()]);

For more information about shopping lists search, see List and search shopping lists.