Skip to content
Open
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
23 changes: 23 additions & 0 deletions code_samples/collaboration/src/Query/Search.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?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;

$now = new DateTimeImmutable();

$query = new SessionQuery(
new Criterion\LogicalAnd([
new Criterion\IsActive(),
new Criterion\Type(‘content’),
new Criterion\CreatedAt($now, Criterion\CreatedAt::OPERATOR_LTE),
]),
[
new SortClause\CreatedAt(SortClause\CreatedAt::SORT_DESC),
]
);

/** @var \Ibexa\Contracts\Collaboration\SessionServiceInterface $sessionService */
$results = $sessionService->findSessions($query);
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@
"ibexa/discounts-codes": "~5.0.x-dev",
"ibexa/core-search": "~5.0.x-dev",
"ibexa/product-catalog-symbol-attribute": "~5.0.x-dev",
"ibexa/messenger": "~5.0.x-dev"
"ibexa/messenger": "~5.0.x-dev",
"ibexa/collaboration": "~5.0.x-dev",
"ibexa/share": "~5.0.x-dev"
},
"scripts": {
"fix-cs": "php-cs-fixer fix --config=.php-cs-fixer.php -v --show-progress=dots",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
month_change: true
---

# 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](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-Invitation-Query-CriterionInterface.html) interface:

| Criterion | Description |
|---|---|
| [CreatedAtCriterion](api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-Invitation-Query-Criterion-CreatedAt.html) | Find invitations based on the date they were created |
| [IdCriterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-Invitation-Query-Criterion-Id.html) | Find invitations with given invitation ID |
| [LogicalAndCriterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-Invitation-Query-Criterion-LogicalAnd.html) | Composite criterion to group multiple invitations using the AND condition |
| [LogicalOrCriterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-Invitation-Query-Criterion-LogicalOr.html) | Composite criterion to group multiple invitations using the OR condition |
| [SenderCriterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-Invitation-Query-Criterion-Sender.html) | Find invitations by invitation sender |
| [SessionCriterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-Invitation-Query-Criterion-Session.html) | Find invitations by collaboration session |
| [StatusCriterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-Invitation-Query-Criterion-Status.html) | Find invitations with given status|
| [UpdatedAtCriterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-Invitation-Query-Criterion-UpdatedAt.html) | Find invitations based on the date they were updated |

## Session Search Criteria

Session Search Criteria are implementing the [CriterionInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-Session-Query-CriterionInterface.html) interface:

| Criterion | Description |
|---|---|
| [CreatedAtCriterion](api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-Session-Query-Criterion-CreatedAt.html) | Find sessions based on the date they were created |
| [EmailCriterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-Session-Query-Criterion-Email.html) | Find sessions based on external participant email |
| [IdCriterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-Session-Query-Criterion-Id.html) | Find sessions with the session ID |
| [IsActiveCriterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-Session-Query-Criterion-IsActive.html) | Find sessions based on active status |
| [LogicalAnd](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-Session-Query-Criterion-LogicalAnd.html) | Composite criterion to group multiple sessions using the AND condition |
| [LogicalOr](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-Session-Query-Criterion-LogicalOr.html) | Composite criterion to group multiple sessions using the OR condition |
| [OwnerCriterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-Session-Query-Criterion-Owner.html) | Find sessions by their owner |
| [ParticipantTokenCriterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-Session-Query-Criterion-ParticipantToken.html) | Find sessions by participant token |
| [TokenCriterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-Session-Query-Criterion-Token.html) | Find sessions with given token|
| [TypeCriterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-Session-Query-Criterion-Type.html) | Find sessions by type |
| [UpdatedAtCriterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-Session-Query-Criterion-UpdatedAt.html) | Find sessions based on the date they were updated |
| [UserIdCriterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-Session-Query-Criterion-UserId.html) | Find sessions with given user ID |

### Example

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

```php hl_lines="11-16"
[[= include_file('code_samples/collaboration/src/Query/Search.php') =]]
```

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 not after the current date
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
month_change: true
---

# Collaboration Search Sort Clauses reference

Sort Clauses are found in the [`Ibexa\Contracts\Collaboration\Value\Query\SortClause`](/api/php_api/php_api_reference/namespaces/ibexa-contracts-collaboration-invitation-query-sortclause.html) namespace.

## Invitation Search Sort Clauses

Invitation Search Sort Clauses are implementing the [SortClauseInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-Invitation-Query-SortClauseInterface.html) interface:

| Name | Description |
| --- | --- |
| [CreatedAt](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-Invitation-Query-SortClause-CreatedAt.html) | Sort by invitation's creation date |
| [Id](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-Invitation-Query-SortClause-Id.html) | Sort by invitation's ID |
| [Status](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-Invitation-Query-SortClause-Status.html)| Sort by invitation's status |
| [UpdatedAt](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-Invitation-Query-SortClause-UpdatedAt.html) | Sort by the date and time when invitation was updated |

## Session Search Sort Clauses

Session Search Sort Clauses are implementing the [SortClauseInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-Session-Query-SortClauseInterface.html) interface:

| Name | Description |
| --- | --- |
| [CreatedAt](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-Session-Query-SortClause-CreatedAt.html) | Sort by session's creation date |
| [Id](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-Session-Query-SortClause-Id.html) | Sort by session's ID |
| [UpdatedAt](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-Session-Query-SortClause-UpdatedAt.html) | Sort by the date and time when session was updated |
3 changes: 2 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -670,12 +670,12 @@ nav:
- UserCriterion: search/activity_log_search_reference/user_criterion.md
- Action Configuration Search Criteria: search/ai_actions_search_reference/action_configuration_criteria.md
- Discounts Search Criteria: search/discounts_search_reference/discounts_criteria.md
- Collaboration Search Criteria: search/collaboration_search_reference
- Notification Search Criteria:
- Notification Search Criteria: search/criteria_reference/notification_search_criteria.md
- DateCreated: search/criteria_reference/notification_datecreated_criterion.md
- Status: search/criteria_reference/notification_status_criterion.md
- Type: search/criteria_reference/notification_type_criterion.md

- Sort Clause reference:
- General Sort Clauses:
- General Sort Clause reference: search/sort_clause_reference/sort_clause_reference.md
Expand Down Expand Up @@ -742,6 +742,7 @@ nav:
- Id Sort Clause: search/url_search_reference/id_url_sort_clause.md
- Url Sort Clause: search/url_search_reference/url_url_sort_clause.md
- Activity Log Sort Clauses: search/activity_log_search_reference/activity_log_sort_clauses.md
- Collaboration Sort Clauses: search/collaboration_search_reference/collaboration_sort_clauses.md
- Action Configuration Sort Clauses: search/ai_actions_search_reference/action_configuration_sort_clauses.md
- Discounts Sort Clauses: search/discounts_search_reference/discounts_sort_clauses.md
- Aggregation reference:
Expand Down