Skip to content

Collaboration Search Criterion reference

Search Criteria are found in the Ibexa\Contracts\Collaboration\Invitation\Query\Criterion namespace.

Invitation Search Criteria

Invitation Search Criteria are implementing the CriterionInterface interface:

Criterion Description
CreatedAt Find invitations based on the date they were created
Id Find invitations with given invitation ID
LogicalAnd Composite criterion to group multiple criteria using the AND condition
LogicalOr Composite criterion to group multiple criteria using the OR condition
Sender Find invitations by invitation sender
Session Find invitations by collaboration session
Status Find invitations with given status
UpdatedAt Find invitations based on the date they were updated

Session Search Criteria

Session Search Criteria are implementing the CriterionInterface interface:

Criterion Description
CreatedAt Find sessions based on the date they were created
Email Find sessions based on external participant email
Id Find sessions with the session ID
IsActive Find sessions based on active status
LogicalAnd Composite criterion to group multiple criteria using the AND condition
LogicalOr Composite criterion to group multiple criteria using the OR condition
Owner Find sessions by their owner
ParticipantToken Find sessions by participant token
Token Find sessions with given token
Type Find sessions by type
UpdatedAt Find sessions based on the date they were updated
UserId Find sessions with given user ID

Example

The following example shows how you can use the criteria to find all the currently active sessions:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
declare(strict_types=1);

use Ibexa\Contracts\Collaboration\Session\Query\Criterion;
use Ibexa\Contracts\Collaboration\Session\Query\SortClause;
use Ibexa\Contracts\Collaboration\Session\SessionQuery;
use Ibexa\Contracts\CoreSearch\Values\Query\Criterion\FieldValueCriterion;
use Ibexa\Contracts\CoreSearch\Values\Query\SortClause\FieldValueSortClause;

$lastWeek = new DateTimeImmutable('-7 days');
$query = new SessionQuery(
    new Criterion\LogicalAnd(
        new Criterion\IsActive(true),
        new Criterion\Type('content'),
        new Criterion\CreatedAt($lastWeek, FieldValueCriterion::COMPARISON_GTE),
    ),
    [
        new SortClause\CreatedAt(FieldValueSortClause::SORT_DESC),
    ]
);
/** @var \Ibexa\Contracts\Collaboration\SessionServiceInterface $sessionService */
$sessionList = $sessionService->findSessions($query);

The criteria limit the result set to sessions matching all of the conditions listed below:

  • session has an active status
  • session has a content type
  • session creation date is within the last week