Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions docs/search/criteria_reference/baseprice_criterion.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The [`BasePrice` Search Criterion](https://github.com/ibexa/core/blob/main/src/c

## Arguments

- `value` - a `Money` object representing the price in a specific currency
- `value` - a `Money\Money` object representing the price in a specific currency
- (optional) `operator` - Operator constant (EQ, GT, GTE, LT, LTE, default EQ)

## Limitations
Expand All @@ -14,5 +14,11 @@ The `BasePrice` Criterion is not available in the Legacy Search engine.
## Example

``` php
$query->query = new Product\Query\Criterion\BasePrice(Money::EUR(12900), BasePrice::GTE);
$query = new ProductQuery(
null,
new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\BasePrice(
\Money\Money::EUR(12900),
\Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\Operator::GTE
)
);
```
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@ The `CheckboxAttribute` Search Criterion searches for products by the value of t
## Example

``` php
$query->query = new Product\Query\Criterion\CheckboxAttribute('automatic', true);
$query = new ProductQuery(
null,
new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\CheckboxAttribute('automatic', true)
);
```
7 changes: 5 additions & 2 deletions docs/search/criteria_reference/colorattribute_criterion.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ The `ColorAttribute` Search Criterion searches for products by the value of thei
## Arguments

- `identifier` - string representing the attribute
- `value` - string representing the attribute value
- `value` - array of strings representing the attribute values

## Example

``` php
$query->query = new Product\Query\Criterion\ColorAttribute('color', '#FF0000');
$query = new ProductQuery(
null,
new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ColorAttribute('color', ['#FF0000'])
);
```
6 changes: 3 additions & 3 deletions docs/search/criteria_reference/createdat_criterion.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ The `CreatedAt` Search Criterion searches for products based on the date when th
## Example

``` php
$criteria = new Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\CreatedAt(
'2022-07-11T00:00:00+02:00'
Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\Operator::GTE,
$criteria = new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\CreatedAt(
new DateTime('2023-03-01'),
\Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\Operator::GTE,
);

$productQuery = new ProductQuery(null, $criteria);
Expand Down
2 changes: 1 addition & 1 deletion docs/search/criteria_reference/createdatrange_criterion.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The `CreatedAtRange` Search Criterion searches for products based on the date ra
## Example

``` php
$criteria = new Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\CreatedAtRange(
$criteria = new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\CreatedAtRange(
new \DateTimeImmutable('2020-07-10T00:00:00+00:00'),
new \DateTimeImmutable('2023-07-12T00:00:00+00:00')
);
Expand Down
10 changes: 8 additions & 2 deletions docs/search/criteria_reference/customprice_criterion.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The `CustomPrice` Search Criterion searches for products by their custom price f

## Arguments

- `value` - a `Money` object representing the price in a specific currency
- `value` - a `Money\Money` object representing the price in a specific currency
- (optional) `operator` - Operator constant (EQ, GT, GTE, LT, LTE, default EQ)
- (optional) `customerGroup` - a `CustomerGroupInterface` object representing the customer group to show prices for.
If you do not provide a customer group, the query uses the group related to the current user.
Expand All @@ -16,5 +16,11 @@ The `CustomPrice` Criterion is not available in the Legacy Search engine.
## Example

``` php
$query->query = new Product\Query\Criterion\CustomPrice(Money::EUR(13800), BasePrice::GTE, $customerGroup);
$query = new ProductQuery(
null,
new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\CustomPrice(
\Money\Money::EUR(13800),
\Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\Operator::GTE,
$customerGroup)
);
```
8 changes: 7 additions & 1 deletion docs/search/criteria_reference/floatattribute_criterion.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,11 @@ The `FloatAttribute` Search Criterion searches for products by the value of thei
## Example

``` php
$query->query = new Product\Query\Criterion\FloatAttribute('length', 16.5);
$query = new ProductQuery(
null,
new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\FloatAttribute(
'length',
16.5
)
);
```
8 changes: 7 additions & 1 deletion docs/search/criteria_reference/integerattribute_criterion.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,11 @@ The `IntegerAttribute` Search Criterion searches for products by the value of th
## Example

``` php
$query->query = new Product\Query\Criterion\IntegerAttribute('size', 38);
$query = new ProductQuery(
null,
new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\IntegerAttribute(
'size',
38
)
);
```
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ The `ProductAvailability` Search Criterion searches for products by their availa
## Example

``` php
$query->query = new Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductAvailability(true);
$query = new ProductQuery(
null,
new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductAvailability(true)
);
```
7 changes: 4 additions & 3 deletions docs/search/criteria_reference/productcategory_criterion.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ The `ProductCategory` Search Criterion searches for products by the category the
## Example

``` php
$criteria = new Criterion\ProductCategory([2, 3]);

$productQuery = new ProductQuery(null, $criteria);
$query = new ProductQuery(
null,
new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductCategory([2, 3])
);
```
7 changes: 5 additions & 2 deletions docs/search/criteria_reference/productcode_criterion.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ The `ProductCode` Search Criterion searches for products by their codes.

## Arguments

- `productCode` - int(s) representing the Product codes(s)
- `productCode` - array of strings representing the Product codes(s)

## Example

``` php
$query->query = new Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductCode([62, 64]);
$query = new ProductQuery(
null,
new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductCode(['ergo_desk', 'alter_desk'])
);
```
5 changes: 4 additions & 1 deletion docs/search/criteria_reference/productname_criterion.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ The `ProductName` Search Criterion searches for products by theis names.
## Example

``` php
$query->query = new Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductName('sofa*');
$query = new ProductQuery(
null,
new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductName('sofa*')
);
```
7 changes: 5 additions & 2 deletions docs/search/criteria_reference/producttype_criterion.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ The `ProductType` Search Criterion searches for products by their codes.

## Arguments

- `productType` - string(s) representing the Product type(s)
- `productType` - array of strings representing the Product type(s)

## Example

``` php
$query->query = new Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductType(['dress']);
$query = new ProductQuery(
null,
new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductType(['dress'])
);
```
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,12 @@ The `RangeMeasurementAttributeMaximum` Search Criterion searches for products by

``` php
$value = $this->measurementService->buildSimpleValue('length', 150, 'centimeter');
$criteria = new Criterion\RangeMeasurementAttributeMaximum('length', $value);

$query = new ProductQuery(
null,
new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\RangeMeasurementAttributeMaximum(
'length',
$value
)
);
```
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,12 @@ The `RangeMeasurementAttributeMinimum` Search Criterion searches for products by

``` php
$value = $this->measurementService->buildSimpleValue('length', 100, 'centimeter');
$criteria = new Criterion\RangeMeasurementAttributeMinimum('length', $value);

$query = new ProductQuery(
null,
new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\RangeMeasurementAttributeMinimum(
'length',
$value
)
);
```
10 changes: 8 additions & 2 deletions docs/search/criteria_reference/selectionattribute_criterion.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@ The `SelectionAttribute` Search Criterion searches for products by the value of
## Arguments

- `identifier` - string representing the attribute
- `value` - string representing the attribute value
- `value` - array of strings representing the attribute values

## Example

``` php
$query->query = new Product\Query\Criterion\SelectionAttribute('fabric_type', 'cotton');
$query = new ProductQuery(
null,
new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\SelectionAttribute(
'fabric_type',
['cotton']
)
);
```
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,12 @@ The `SimpleMeasurementAttribute` Search Criterion searches for products by the v

``` php
$value = $this->measurementService->buildSimpleValue('length', 120, 'centimeter');
$criteria = new Criterion\SimpleMeasurementAttribute('width', $value);

$query = new ProductQuery(
null,
new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\SimpleMeasurementAttribute(
'width',
$value
)
);
```
7 changes: 6 additions & 1 deletion docs/search/sort_clause_reference/baseprice_sort_clause.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ The `BasePrice` Sort Clause is not available in the Legacy Search engine.
## Example

``` php
$sortClauses = [new SortClause\BasePrice($currency, ProductQuery::SORT_ASC)];
$sortClauses = [
new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\SortClause\BasePrice(
$currency,
ProductQuery::SORT_ASC
)
];
$productQuery = new ProductQuery(null, null, $sortClauses);
```
5 changes: 3 additions & 2 deletions docs/search/sort_clause_reference/createdat_sort_clause.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ The `CreatedAt` Sort Clause sorts search results by the date and time of the cre
``` php
$productQuery = new ProductQuery(
null,
$criteria,
null,
[
new CreatedAt(CreatedAt::SORT_ASC)
new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\SortClause\CreatedAt(
\Ibexa\Contracts\ProductCatalog\Values\Product\Query\SortClause\CreatedAt::SORT_ASC)
]
);
```
7 changes: 6 additions & 1 deletion docs/search/sort_clause_reference/customprice_sort_clause.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ The `CustomPrice` Sort Clause is not available in the Legacy Search engine.
## Example

``` php
$sortClauses = [new SortClause\CustomPrice($currency, ProductQuery::SORT_ASC, $customerGroup)];
$sortClauses = [
new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\SortClause\CustomPrice(
$currency,
ProductQuery::SORT_ASC, $customerGroup
)
];
$productQuery = new ProductQuery(null, null, $sortClauses);
```
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ The `ProductAvailability` Sort Clause sorts search results by whether they have
## Example

``` php
$query = new Query();
$query->sortClauses = [new Ibexa\Contracts\ProductCatalog\Values\Product\Query\SortClause\ProductAvailability()];
$query = new ProductQuery(
null,
null,
[
new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\SortClause\ProductAvailability()
]
);
```
9 changes: 7 additions & 2 deletions docs/search/sort_clause_reference/productcode_sort_clause.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ The `ProductCode` Sort Clause sorts search results by the Product code.
## Example

``` php
$query = new LocationQuery();
$query->sortClauses = [new Ibexa\Contracts\ProductCatalog\Values\Product\Query\SortClause\ProductCode()];
$query = new ProductQuery(
null,
null,
[
new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\SortClause\ProductCode()
]
);
```
9 changes: 7 additions & 2 deletions docs/search/sort_clause_reference/productname_sort_clause.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ The `ProductName` Sort Clause sorts search results by the Product code.
## Example

``` php
$query = new LocationQuery();
$query->sortClauses = [new Ibexa\Contracts\ProductCatalog\Values\Product\Query\SortClause\ProductName()];
$query = new ProductQuery(
null,
null,
[
new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\SortClause\ProductName()
]
);
```