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

DepthRange.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\Search\Elasticsearch\Content\Location\CriterionVisitor\Location;
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 DepthRange extends CriterionVisitor
18 {
26 public function canVisit(Criterion $criterion)
27 {
28 return
29 $criterion instanceof Criterion\Location\Depth &&
30 (
31 $criterion->operator === Operator::LT ||
32 $criterion->operator === Operator::LTE ||
33 $criterion->operator === Operator::GT ||
34 $criterion->operator === Operator::GTE ||
35 $criterion->operator === Operator::BETWEEN
36 );
37 }
38
50 public function visitFilter(Criterion $criterion, Dispatcher $dispatcher, array $languageFilter)
51 {
52 $start = $criterion->value[0];
53 $end = isset($criterion->value[1]) ? $criterion->value[1] : null;
54
55 return [
56 'range' => [
57 'depth_i' => $this->getFilterRange($criterion->operator, $start, $end),
58 ],
59 ];
60 }
61 }
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\LT
const LT
Definition: API/Repository/Values/Content/Query/Criterion/Operator.php:19
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\LTE
const LTE
Definition: API/Repository/Values/Content/Query/Criterion/Operator.php:20
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\GT
const GT
Definition: API/Repository/Values/Content/Query/Criterion/Operator.php:17
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\BETWEEN
const BETWEEN
Definition: API/Repository/Values/Content/Query/Criterion/Operator.php:22
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\GTE
const GTE
Definition: API/Repository/Values/Content/Query/Criterion/Operator.php:18
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
Visits the criterion tree into a hash representation of Elasticsearch query/filter AST.
Definition: CriterionVisitor.php:19
eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\getFilterRange
getFilterRange($operator, $start, $end)
Get Elasticsearch range filter.
Definition: CriterionVisitor.php:141
eZ\Publish\Core\Search\Elasticsearch\Content\Location\CriterionVisitor\Location\DepthRange
Visits the Depth criterion with range operators (LT, LTE, GT, GTE and BETWEEN).
Definition: DepthRange.php:18
eZ\Publish\Core\Search\Elasticsearch\Content\Location\CriterionVisitor\Location\DepthRange\visitFilter
visitFilter(Criterion $criterion, Dispatcher $dispatcher, array $languageFilter)
Map field value to a proper Elasticsearch filter representation.
Definition: DepthRange.php:50
eZ\Publish\Core\Search\Elasticsearch\Content\Location\CriterionVisitor\Location\DepthRange\canVisit
canVisit(Criterion $criterion)
Check if visitor is applicable to current criterion.
Definition: DepthRange.php:26
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
eZ\Publish\Core\Search\Elasticsearch\Content\Location\CriterionVisitor\Location
Definition: DepthIn.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.