Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Core/Search/Elasticsearch/Content/Common/CriterionVisitor/LogicalOr.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\Search\Elasticsearch\Content\Common\CriterionVisitor;
8
9 use eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitorDispatcher as Dispatcher;
10 use eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor;
11 use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
12
16 class LogicalOr extends CriterionVisitor
17 {
25 public function canVisit(Criterion $criterion)
26 {
27 return $criterion instanceof Criterion\LogicalOr;
28 }
29
39 public function visitFilter(Criterion $criterion, Dispatcher $dispatcher, array $languageFilter)
40 {
41 /* @var $criterion \eZ\Publish\API\Repository\Values\Content\Query\Criterion\LogicalOperator */
42 return [
43 'or' => array_map(
44 function ($value) use ($dispatcher, $languageFilter) {
45 return $dispatcher->dispatch($value, Dispatcher::CONTEXT_FILTER, $languageFilter);
46 },
47 $criterion->criteria
48 ),
49 ];
50 }
51
61 public function visitQuery(Criterion $criterion, Dispatcher $dispatcher, array $languageFilter)
62 {
63 /* @var $criterion \eZ\Publish\API\Repository\Values\Content\Query\Criterion\LogicalOperator */
64 return [
65 'bool' => [
66 'should' => array_map(
67 function ($value) use ($dispatcher, $languageFilter) {
68 return $dispatcher->dispatch($value, Dispatcher::CONTEXT_FILTER, $languageFilter);
69 },
70 $criterion->criteria
71 ),
72 'minimum_should_match' => 1,
73 ],
74 ];
75 }
76 }
eZ\Publish\API\Repository\Values\Content\Query\Criterion\LogicalOr
This criterion implements a logical OR criterion and will only match if AT LEAST ONE of the given cri...
Definition: API/Repository/Values/Content/Query/Criterion/LogicalOr.php:14
eZ\Publish\API\Repository\Values\Content\Query\Criterion
Definition: API/Repository/Values/Content/Query/Criterion.php:15
eZ\Publish\Core\Search\Elasticsearch\Content\Common\CriterionVisitor\LogicalOr\visitFilter
visitFilter(Criterion $criterion, Dispatcher $dispatcher, array $languageFilter)
Map field value to a proper Elasticsearch filter representation.
Definition: Core/Search/Elasticsearch/Content/Common/CriterionVisitor/LogicalOr.php:39
eZ\Publish\Core\Search\Elasticsearch\Content\Common\CriterionVisitor\LogicalOr\visitQuery
visitQuery(Criterion $criterion, Dispatcher $dispatcher, array $languageFilter)
Map field value to a proper Elasticsearch query representation.
Definition: Core/Search/Elasticsearch/Content/Common/CriterionVisitor/LogicalOr.php:61
eZ\Publish\Core\Search\Elasticsearch\Content\Common\CriterionVisitor\LogicalOr\canVisit
canVisit(Criterion $criterion)
Check if visitor is applicable to current criterion.
Definition: Core/Search/Elasticsearch/Content/Common/CriterionVisitor/LogicalOr.php:25
eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitorDispatcher
Dispatches Criterion objects to a visitor depending on the query context.
Definition: CriterionVisitorDispatcher.php:19
eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor
Visits the criterion tree into a hash representation of Elasticsearch query/filter AST.
Definition: CriterionVisitor.php:19
eZ\Publish\API\Repository\Values\Content\Query\Criterion
Definition: API/Repository/Values/Content/Query/Criterion/Ancestor.php:7
eZ\Publish\Core\Search\Elasticsearch\Content\Common\CriterionVisitor
Definition: Core/Search/Elasticsearch/Content/Common/CriterionVisitor/LogicalAnd.php:7
eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor
Definition: CriterionVisitor/ContentIdIn.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.