- Documentation >
- Search >
- Notification Search Criteria >
- Status
Notification Status Criterion
The Status
Search Criterion searches for notifications based on notification status.
Arguments
status
- Boolean value that represents the status of the notification
Example
PHP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 | <?php
declare(strict_types=1);
use Ibexa\Contracts\Core\Repository\Values\Notification\Query\Criterion\DateCreated;
use Ibexa\Contracts\Core\Repository\Values\Notification\Query\Criterion\Status;
use Ibexa\Contracts\Core\Repository\Values\Notification\Query\Criterion\Type;
use Ibexa\Contracts\Core\Repository\Values\Notification\Query\NotificationQuery;
/** @var \Ibexa\Contracts\Core\Repository\NotificationService $notificationService */
$query = new NotificationQuery([], 0, 25);
$query->addCriterion(new Type('Workflow:Review'));
$query->addCriterion(new Status(['unread']));
$from = new \DateTimeImmutable('-7 days');
$to = new \DateTimeImmutable();
$query->addCriterion(new DateCreated($from, $to));
$notificationList = $notificationService->findNotifications($query);
|