Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace App\Dispatcher;

use Symfony\Component\Messenger\MessageBusInterface;
use Symfony\Component\Messenger\Envelope;
use Ibexa\Messenger\Stamp\DeduplicateStamp;

final class SomeClassThatSchedulesExecutionInTheBackground
{
private MessageBusInterface $bus;

public function __construct(MessageBusInterface $bus)
{
$this->bus = $bus;
}

public function schedule(object $message): void
{
// Dispatch directly. Message is wrapped with envelope without any stamps.
$this->bus->dispatch($message);

// Alternatively, wrap with stamps. In this case, DeduplicateStamp ensures
// that if similar command exists in the queue (or is being processed)
// it will not be queued again.
$envelope = Envelope::wrap(
$message,
[new DeduplicateStamp('command-name-1')]
);

$this->bus->dispatch($envelope);
}
}
8 changes: 8 additions & 0 deletions code_samples/background_tasks/src/Message/SomeMessage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace App\Message;

class SomeMessage
{
// Add properties and methods as needed for your message.
}
14 changes: 14 additions & 0 deletions code_samples/background_tasks/src/MessageHandler/SomeHandler.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace App\MessageHandler;

use App\Message\SomeMessage;
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;

final class SomeHandler implements MessageHandlerInterface
{
public function __invoke(SomeMessage $message): void
{
// Handle message.
}
}
2 changes: 2 additions & 0 deletions docs/api/event_reference/discounts_events.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ The events below are dispatched when managing [discounts](discounts_guide.md):
|---|---|
|[BeforeCreateDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-BeforeCreateDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html) |
|[CreateDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-CreateDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html) |
|[BeforeEnableDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-BeforeEnableDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html) |
|[EnableDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-EnableDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html) |
|[BeforeDeleteDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-BeforeDeleteDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html) |
|[DeleteDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-DeleteDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html) |
|[BeforeUpdateDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-BeforeUpdateDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html)|
Expand Down
29 changes: 29 additions & 0 deletions docs/discounts/configure_discounts.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,35 @@ ibexa:
products_list_per_page_limit: 15
```

## Discount re-indexing

Discounts feature uses [[= product_name_base =]] Messenger to reindex discounts and product prices in the background.
This way changes are processed efficiently without slowing down the system and disrupting the user experience.

When triggered periodically, the `ibexa:discounts:reindex` command identifies discounts that require re-indexing, ensuring catalog prices always remain up-to-date.
If there are edits to discounts that should result in changed product catalog prices, messages are dispatched to the [[= product_name_base =]] Messenger's queue and consumed by a background worker.
The worker passes the messages to the handler, which then starts the re-indexing process at the most convenient moment.

To run discount re-indexing in the background:

1\. Make sure that the transport layer is [defined properly](background_tasks.md#configure-package) in [[= product_name_base =]] Messenger configuration.

2\. Make sure that the worker starts together with the application to watch the transport bus:

``` bash
php bin/console messenger:consume ibexa.messenger.transport --bus=ibexa.messenger.bus
```

3\. Use a scheduler of your choice, for example, [cron](https://en.wikipedia.org/wiki/Cron), to periodically run the following command:

``` bash
php bin/console ibexa:discounts:reindex
```

!!! note "Deploying Symfony Messenger"

For more information about deploying the Messenger to production, see [Symfony documentation](https://symfony.com/doc/current/messenger.html#deploying-to-production).

## Rate limiting

To prevent malicious actors from trying all the possible discount code combinations using brute-force attacks, the [`/discounts_codes/{cartIdentifier}/apply` endpoint](/api/rest_api/rest_api_reference/rest_api_reference.html#discount-codes-apply-discount-to-cart) is rate limited using the [Rate Limiter Symfony component]([[= symfony_doc =]]/rate_limiter.html).
Expand Down
9 changes: 9 additions & 0 deletions docs/discounts/discounts_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,15 @@
- limited use: every customer can use the code a specified number of times
- unlimited

### Discount re-indexing

Discounts affect the prices shown in the product catalog.
When a discount is created, updated, or expires, the product catalog must be re-indexed to ensure that the search results and product listings display correct prices.

Check warning on line 119 in docs/discounts/discounts_guide.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/discounts/discounts_guide.md#L119

[Ibexa.OxfordComma] Use a comma before the last 'and' or 'or' in a list of four or more items.
Raw output
{"message": "[Ibexa.OxfordComma] Use a comma before the last 'and' or 'or' in a list of four or more items.", "location": {"path": "docs/discounts/discounts_guide.md", "range": {"start": {"line": 119, "column": 1}}}, "severity": "WARNING"}

To prevent performance disruptions which could occur if re-indexing occurred immediately, [[= product_name =]] uses the [[= product_name_base =]] Messenger's [background queue](background_tasks.md) to process re-indexing tasks in the background.

By [configuring the process](configure_discounts.md#discount-re-indexing), you ensure that re-indexing is performed at the most convenient time to maintain your application's overall stability.

## Capabilities

### Management
Expand Down
102 changes: 102 additions & 0 deletions docs/infrastructure_and_maintenance/background_tasks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---

Check warning on line 1 in docs/infrastructure_and_maintenance/background_tasks.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/infrastructure_and_maintenance/background_tasks.md#L1

[Ibexa.ReadingLevel] The grade level is 8.29. Aim for 8th grade or lower by using shorter sentences and words.
Raw output
{"message": "[Ibexa.ReadingLevel] The grade level is 8.29. Aim for 8th grade or lower by using shorter sentences and words.", "location": {"path": "docs/infrastructure_and_maintenance/background_tasks.md", "range": {"start": {"line": 1, "column": 1}}}, "severity": "WARNING"}
description: Use Ibexa Messenger to run processes in the background and conserve system resources.

Check failure on line 2 in docs/infrastructure_and_maintenance/background_tasks.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/infrastructure_and_maintenance/background_tasks.md#L2

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/infrastructure_and_maintenance/background_tasks.md", "range": {"start": {"line": 2, "column": 18}}}, "severity": "ERROR"}
month_change: true
---

# Background tasks

Some operations in [[= product_name =]] don’t have to run immediately when a user clicks a button, for example, re-indexing product prices or processing bulk data.

Check warning on line 8 in docs/infrastructure_and_maintenance/background_tasks.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/infrastructure_and_maintenance/background_tasks.md#L8

[Ibexa.OxfordComma] Use a comma before the last 'and' or 'or' in a list of four or more items.
Raw output
{"message": "[Ibexa.OxfordComma] Use a comma before the last 'and' or 'or' in a list of four or more items.", "location": {"path": "docs/infrastructure_and_maintenance/background_tasks.md", "range": {"start": {"line": 8, "column": 45}}}, "severity": "WARNING"}
Running such operations in real time could slow down the system and disrupt the user experience.

To solve this, [[= product_name =]] provides a package called [[= product_name_base =]] Messenger, which is an overlay to [Symfony Messenger](https://symfony.com/doc/current/messenger.html), and it's job is to queue tasks and run them in the background.
[[= product_name =]] sends messages (or commands) that represent the work tto be done later.
These messages are stored in a queue and picked up by a background worker, which ensures that resource-heavy tasks are executed at a convenient time, without putting excessive load on the system.

[[= product_name_base =]] Messenger supports multiple storage backends, such as Doctrine, Redis, and PostgreSQL, and gives developers the flexibility to create their own message handlers for custom use cases.

## How it works

Check warning on line 17 in docs/infrastructure_and_maintenance/background_tasks.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/infrastructure_and_maintenance/background_tasks.md#L17

[Ibexa.HeadingContent] Rename the heading '## How it works', or re-purpose the content elsewhere.
Raw output
{"message": "[Ibexa.HeadingContent] Rename the heading '## How it works', or re-purpose the content elsewhere.", "location": {"path": "docs/infrastructure_and_maintenance/background_tasks.md", "range": {"start": {"line": 17, "column": 1}}}, "severity": "WARNING"}

[[= product_name_base =]] Messenger uses a command bus as a queue that stores messages, or commands, which tell the system what you want to happen, and separates them from the handler, which is the code that actually performs the task.

The process works as follows:

1. A message PHP object is dispatched, for example, `ProductPriceReindex`.

Check failure on line 23 in docs/infrastructure_and_maintenance/background_tasks.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/infrastructure_and_maintenance/background_tasks.md#L23

[Ibexa.Lists] Do not put fullstops at the end of bullets
Raw output
{"message": "[Ibexa.Lists] Do not put fullstops at the end of bullets", "location": {"path": "docs/infrastructure_and_maintenance/background_tasks.md", "range": {"start": {"line": 23, "column": 74}}}, "severity": "ERROR"}
2. The message is wrapped in an envelope, which may contain additional metadata, called stamps, for example, `DeduplicateStamp`.

Check failure on line 24 in docs/infrastructure_and_maintenance/background_tasks.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/infrastructure_and_maintenance/background_tasks.md#L24

[Ibexa.Lists] Do not put fullstops at the end of bullets
Raw output
{"message": "[Ibexa.Lists] Do not put fullstops at the end of bullets", "location": {"path": "docs/infrastructure_and_maintenance/background_tasks.md", "range": {"start": {"line": 24, "column": 128}}}, "severity": "ERROR"}
3. The message is placed in the transport queue.
It can be a Doctrine table, a Redis queue, and so on.

Check warning on line 26 in docs/infrastructure_and_maintenance/background_tasks.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/infrastructure_and_maintenance/background_tasks.md#L26

[Ibexa.Wordy] Remove 'and so on'. Try to use 'like' and provide examples instead.
Raw output
{"message": "[Ibexa.Wordy] Remove 'and so on'. Try to use 'like' and provide examples instead.", "location": {"path": "docs/infrastructure_and_maintenance/background_tasks.md", "range": {"start": {"line": 26, "column": 44}}}, "severity": "WARNING"}

Check failure on line 26 in docs/infrastructure_and_maintenance/background_tasks.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/infrastructure_and_maintenance/background_tasks.md#L26

[Ibexa.Lists] Do not put fullstops at the end of bullets
Raw output
{"message": "[Ibexa.Lists] Do not put fullstops at the end of bullets", "location": {"path": "docs/infrastructure_and_maintenance/background_tasks.md", "range": {"start": {"line": 26, "column": 53}}}, "severity": "ERROR"}
4. A worker process continuously reads messages from the queue, pulls them into the default bus `ibexa.messenger.bus` and assigns them to the right handler.

Check failure on line 27 in docs/infrastructure_and_maintenance/background_tasks.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/infrastructure_and_maintenance/background_tasks.md#L27

[Ibexa.Lists] Do not put fullstops at the end of bullets
Raw output
{"message": "[Ibexa.Lists] Do not put fullstops at the end of bullets", "location": {"path": "docs/infrastructure_and_maintenance/background_tasks.md", "range": {"start": {"line": 27, "column": 103}}}, "severity": "ERROR"}
5. A handler service processes the message (executes the command).
You can register multiple handlers for different jobs.

Check failure on line 29 in docs/infrastructure_and_maintenance/background_tasks.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/infrastructure_and_maintenance/background_tasks.md#L29

[Ibexa.Lists] Do not put fullstops at the end of bullets
Raw output
{"message": "[Ibexa.Lists] Do not put fullstops at the end of bullets", "location": {"path": "docs/infrastructure_and_maintenance/background_tasks.md", "range": {"start": {"line": 29, "column": 54}}}, "severity": "ERROR"}

Here is an example of how you can extend your code and use [[= product_name_base =]] Messenger to process your tasks:

### Configure package

Create a config file, for example, `config/packages/ibexa_messenger.yaml` and define your transport:

``` yaml
ibexa_messenger:

# The DSN of the transport, as expected by Symfony Messenger transport factory.
transport_dsn: 'doctrine://default?table_name=ibexa_messenger_messages&auto_setup=false'
deduplication_lock_storage:
enabled: true

# Doctrine DBAL primary connection or custom service
type: doctrine # One of "doctrine"; "custom"; "service"

# The service ID of a custom Lock Store, if "service" type is selected
service: null

# The DSN of the lock store, if "custom" type is selected
dsn: null
```
!!! note "Supported transports"
You can define different transports: [[= product_name_base =]] Messenger has been tested to work with Redis, MySQL, PostgreSQL.
For more information, see [Symfony Messenger documentation](https://symfony.com/doc/current/messenger.html#transports-async-queued-messages) or [Symfony Messenger tutorial](https://symfonycasts.com/screencast/messenger/install#installing-messenger).
### Start worker
Use a process manager of your choice to run the following command, or make it start together with the server:
``` bash
php bin/console messenger:consume ibexa.messenger.transport --bus=ibexa.messenger.bus --siteaccess=<OPTIONAL>`
```

In multi-repository setups, the worker process always works for a repository that you indicate by using the `--siteaccess` option, therefore you may need to run multiple workers, one for each SiteAccess.

!!! warning "Multi-repository setups"

Doctrine transport works across multiple repositories without issues, but other transports may need to be adjusted, so that queues across different repositories are not accidentally shared.

!!! note "Deploying [[= product_name_base =]] Messenger"

Additional considerations regarding the deployment of Symfony Messenger to production, which you can find in [Symfony documentation](https://symfony.com/doc/current/messenger.html#deploying-to-production) apply to [[= product_name_base =]] Messenger as well.

### Dispatch message

Dispatch a message from your code like in the following example:

``` php
[[= include_file("code_samples/background_tasks/src/Dispatcher/SomeClassThatSchedulesExecutionInTheBackground.php") =]]
```

### Register handler

Create the handler class:

``` php
[[= include_file("code_samples/background_tasks/src/MessageHandler/SomeHandler.php") =]]
```

Add a service definition to `config/services.yaml`:

``` yaml
services:
Ibexa\Bundle\Foo\Message\SomeHandler:
tags:
- name: messenger.message_handler
bus: ibexa.messenger.bus
```
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ page_type: landing_page
"infrastructure_and_maintenance/cache/cache",
"infrastructure_and_maintenance/clustering/clustering",
"infrastructure_and_maintenance/performance",
"infrastructure_and_maintenance/background_tasks",
"infrastructure_and_maintenance/databases",
"infrastructure_and_maintenance/environments",
"infrastructure_and_maintenance/support_and_maintenance_faq",
Expand Down
12 changes: 7 additions & 5 deletions docs/search/discounts_search_reference/discounts_criteria.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,19 @@

| Criterion | Description |
|---|---|
| [CreatedAtCriterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-Criterion-CreatedAtCriterion.html) | Find discounts with given creation date|
| [CreatorCriterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-Criterion-CreatorCriterion.html) | Find discounts created by specific users|
| [CreatedAtCriterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-Criterion-CreatedAtCriterion.html) | Find discounts with given creation date |

Check failure on line 13 in docs/search/discounts_search_reference/discounts_criteria.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/search/discounts_search_reference/discounts_criteria.md#L13

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/search/discounts_search_reference/discounts_criteria.md", "range": {"start": {"line": 13, "column": 63}}}, "severity": "ERROR"}
| [CreatorCriterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-Criterion-CreatorCriterion.html) | Find discounts created by specific users |

Check failure on line 14 in docs/search/discounts_search_reference/discounts_criteria.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/search/discounts_search_reference/discounts_criteria.md#L14

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/search/discounts_search_reference/discounts_criteria.md", "range": {"start": {"line": 14, "column": 61}}}, "severity": "ERROR"}
| [EndDateCriterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-Criterion-EndDateCriterion.html) | Find discounts by their end date. For permanent discounts, the end date is set to `null` |
| [IndexedAtCriterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-Criterion-IndexedAtCriterion.html) | Find discounts based on the date and time when they were indexed |

Check failure on line 16 in docs/search/discounts_search_reference/discounts_criteria.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/search/discounts_search_reference/discounts_criteria.md#L16

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/search/discounts_search_reference/discounts_criteria.md", "range": {"start": {"line": 16, "column": 63}}}, "severity": "ERROR"}
| [IdentifierCriterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-Criterion-IdentifierCriterion.html) | Find discounts by their identifier |
| [IsEnabledCriterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-Criterion-IsEnabledCriterion.html) | Find discounts by their status|
| [IsEnabledCriterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-Criterion-IsEnabledCriterion.html) | Find discounts by their status |

Check failure on line 18 in docs/search/discounts_search_reference/discounts_criteria.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/search/discounts_search_reference/discounts_criteria.md#L18

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/search/discounts_search_reference/discounts_criteria.md", "range": {"start": {"line": 18, "column": 63}}}, "severity": "ERROR"}
| [LogicalAnd](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-Criterion-LogicalAnd.html) | Composite criterion to group multiple criterions using the AND condition |
| [LogicalOr](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-Criterion-LogicalOr.html) | Composite criterion to group multiple criterions using the OR condition |
| [NameCriterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-Criterion-NameCriterion.html) | Find discounts by their name |
| [PriorityCriterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-Criterion-PriorityCriterion.html) | Find discounts by their priority |
| [StartDateCriterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-Criterion-StartDateCriterion.html) | Find discounts with given start date|
| [TypeCriterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-Criterion-TypeCriterion.html) | Find cart or catalog discounts by using constants from the [DiscountType](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-DiscountType.html) class|
| [StartDateCriterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-Criterion-StartDateCriterion.html) | Find discounts with given start date |

Check failure on line 23 in docs/search/discounts_search_reference/discounts_criteria.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/search/discounts_search_reference/discounts_criteria.md#L23

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/search/discounts_search_reference/discounts_criteria.md", "range": {"start": {"line": 23, "column": 63}}}, "severity": "ERROR"}
| [TypeCriterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-Criterion-TypeCriterion.html) | Find cart or catalog discounts by using constants from the [DiscountType](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-DiscountType.html) class |

Check failure on line 24 in docs/search/discounts_search_reference/discounts_criteria.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/search/discounts_search_reference/discounts_criteria.md#L24

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/search/discounts_search_reference/discounts_criteria.md", "range": {"start": {"line": 24, "column": 241}}}, "severity": "ERROR"}
| [UpdatedAtCriterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-Criterion-UpdatedAtCriterion.html) | Find discounts based on the date and time when they were indexed |

Check failure on line 25 in docs/search/discounts_search_reference/discounts_criteria.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/search/discounts_search_reference/discounts_criteria.md#L25

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/search/discounts_search_reference/discounts_criteria.md", "range": {"start": {"line": 25, "column": 63}}}, "severity": "ERROR"}

You can use the [FieldValueCriterion's constants](/api/php_api/php_api_reference/classes/Ibexa-Contracts-CoreSearch-Values-Query-Criterion-FieldValueCriterion.html#constants) like `FieldValueCriterion::COMPARISON_CONTAINS` or `FieldValueCriterion::COMPARISON_STARTS_WITH` to specify the operator for the condition.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
| [EndDate](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-SortClause-EndDate.html)| Sort by discount's end date |
| [Id](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-SortClause-Id.html)| Sort by discount's database ID |
| [Identifier](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-SortClause-Identifier.html)| Sort by discount identifier |
| [OverridePrioritization](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-SortClause-OverridePrioritization.html)| Sort prioritizing discounts with discount code over automatic ones |

Check failure on line 17 in docs/search/discounts_search_reference/discounts_sort_clauses.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/search/discounts_search_reference/discounts_sort_clauses.md#L17

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/search/discounts_search_reference/discounts_sort_clauses.md", "range": {"start": {"line": 17, "column": 67}}}, "severity": "ERROR"}
| [Priority](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-SortClause-Priority.html)| Sort by discount priority |
| [StartDate](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-SortClause-StartDate.html)| Sort by discount start date |
| [Type](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-SortClause-Type.html)| Sort by the place where the discount activates: catalog or cart. When sorting with ascending order, cart discounts are returned first. |
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,7 @@ nav:
- DevOps: infrastructure_and_maintenance/devops.md
- Backup: infrastructure_and_maintenance/backup.md
- Performance: infrastructure_and_maintenance/performance.md
- Background tasks: infrastructure_and_maintenance/background_tasks.md
- Environments: infrastructure_and_maintenance/environments.md
- Sessions: infrastructure_and_maintenance/sessions.md
- Logging: infrastructure_and_maintenance/logging.md
Expand Down
Loading