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

Core/Search/Elasticsearch/Content/CriterionVisitor/Visibility.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\Search\Elasticsearch\Content\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 use eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator;
13
17 class Visibility extends CriterionVisitor
18 {
26 public function canVisit(Criterion $criterion)
27 {
28 return $criterion instanceof Criterion\Visibility && $criterion->operator === Operator::EQ;
29 }
30
38 protected function getInternalValue(Criterion $criterion)
39 {
40 return $criterion->value[0] === Criterion\Visibility::HIDDEN;
41 }
42
52 public function visitFilter(Criterion $criterion, Dispatcher $dispatcher, array $languageFilter)
53 {
54 return [
55 'nested' => [
56 'path' => 'locations_doc',
57 'filter' => [
58 'term' => [
59 'invisible_b' => $this->getInternalValue($criterion),
60 ],
61 ],
62 ],
63 ];
64 }
65
75 public function visitQuery(Criterion $criterion, Dispatcher $dispatcher, array $languageFilter)
76 {
77 return [
78 'nested' => [
79 'path' => 'locations_doc',
80 'query' => [
81 'term' => [
82 'invisible_b' => $this->getInternalValue($criterion),
83 ],
84 ],
85 ],
86 ];
87 }
88 }
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\EQ
const EQ
Definition: API/Repository/Values/Content/Query/Criterion/Operator.php:16
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Visibility
A criterion that matches content based on its visibility.
Definition: API/Repository/Values/Content/Query/Criterion/Visibility.php:21
eZ\Publish\API\Repository\Values\Content\Query\Criterion
Definition: API/Repository/Values/Content/Query/Criterion.php:15
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\Visibility\visitFilter
visitFilter(Criterion $criterion, Dispatcher $dispatcher, array $languageFilter)
Map field value to a proper Elasticsearch filter representation.
Definition: Core/Search/Elasticsearch/Content/CriterionVisitor/Visibility.php:52
eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\Visibility\getInternalValue
getInternalValue(Criterion $criterion)
Map Criterion visibility value to a proper Elasticsearch representation.
Definition: Core/Search/Elasticsearch/Content/CriterionVisitor/Visibility.php:38
eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\Visibility\visitQuery
visitQuery(Criterion $criterion, Dispatcher $dispatcher, array $languageFilter)
Map field value to a proper Elasticsearch query representation.
Definition: Core/Search/Elasticsearch/Content/CriterionVisitor/Visibility.php:75
eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\Visibility\canVisit
canVisit(Criterion $criterion)
Check if visitor is applicable to current criterion.
Definition: Core/Search/Elasticsearch/Content/CriterionVisitor/Visibility.php:26
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\Operator
Definition: Specifications.php:7
eZ\Publish\API\Repository\Values\Content\Query\Criterion
Definition: API/Repository/Values/Content/Query/Criterion/Ancestor.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+.