Skip to content

Action Configuration Search Criterion reference

Search criterions are found in the Ibexa\Contracts\ConnectorAi\ActionConfiguration\Query\Criterion namespace, implementing the CriterionInterface interface:

Criterion Description
Name Find Action Configurations matching given name. Use FieldValueCriterion's constants like FieldValueCriterion::COMPARISON_CONTAINS or FieldValueCriterion::COMPARISON_STARTS_WITH to specify the matching condition
Enabled Find enabled or disabled Action Configurations
Identifier Find Action Configuration having the exact given identifier
LogicalAnd Composite criterion to group multiple criterions using the AND condition
LogicalOr Composite criterion to group multiple criterions using the OR condition
Type Find Action Configuration having the exact given type

The following example shows how to use them to find specific Action Configurations:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php

declare(strict_types=1);

use Ibexa\Contracts\ConnectorAi\ActionConfiguration\ActionConfigurationQuery;
use Ibexa\Contracts\ConnectorAi\ActionConfiguration\Query\Criterion;
use Ibexa\Contracts\ConnectorAi\ActionConfiguration\Query\SortClause;
use Ibexa\Contracts\CoreSearch\Values\Query\AbstractSortClause;
use Ibexa\Contracts\CoreSearch\Values\Query\Criterion\FieldValueCriterion;

$query = new ActionConfigurationQuery(
    new Criterion\LogicalAnd(
        new Criterion\Enabled(),
        new Criterion\LogicalOr(
            new Criterion\Name('Casual', FieldValueCriterion::COMPARISON_STARTS_WITH),
            new Criterion\Identifier('casual')
        )
    ),
    [
        new SortClause\Enabled(AbstractSortClause::SORT_DESC),
        new SortClause\Identifier(AbstractSortClause::SORT_ASC),
    ]
);
/** @var \Ibexa\Contracts\ConnectorAi\ActionConfigurationServiceInterface $actionConfigurationService */
$results = $actionConfigurationService->findActionConfigurations($query);

The result set contains Action Configurations that are:

  • enabled, and
  • with an identifier equal to casual or with a name starting with Casual.