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

Public Member Functions | Protected Member Functions | List of all members
eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor Class Reference

Visits the criterion tree into a hash representation of Elasticsearch query/filter AST. More...

Inheritance diagram for eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor:

## Public Member Functions
| canVisit (Criterion $criterion)
| Check if visitor is applicable to current criterion. More...
| visitFilter (Criterion $criterion, CriterionVisitorDispatcher $dispatcher, array $languageFilter)
| Map field value to a proper Elasticsearch filter representation. More...
| visitQuery (Criterion $criterion, CriterionVisitorDispatcher $dispatcher, array $languageFilter)
| Map field value to a proper Elasticsearch query representation. More...

## Protected Member Functions
| getQueryRange ($operator, $start, $end)
| Get Elasticsearch range query. More...
| getFilterRange ($operator, $start, $end)
| Get Elasticsearch range filter. More...
| prepareValue ($value)
| Converts given $value to the appropriate Elasticsearch representation. More...

## Detailed Description

Visits the criterion tree into a hash representation of Elasticsearch query/filter AST.

Deprecated:

Definition at line 18 of file CriterionVisitor.php.

## Member Function Documentation

## ◆ canVisit()

eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor::canVisit | ( | Criterion | $criterion | ) |
| abstract

Check if visitor is applicable to current criterion.

Parameters

  \eZ\Publish\API\Repository\Values\Content\Query\Criterion | $criterion |

Returns
  bool

Reimplemented in eZ\Publish\Core\Search\Elasticsearch\Content\Location\CriterionVisitor\Visibility, eZ\Publish\Core\Search\Elasticsearch\Content\Location\CriterionVisitor\UserMetadataIn, eZ\Publish\Core\Search\Elasticsearch\Content\Location\CriterionVisitor\SubtreeIn, eZ\Publish\Core\Search\Elasticsearch\Content\Location\CriterionVisitor\SectionIdIn, eZ\Publish\Core\Search\Elasticsearch\Content\Location\CriterionVisitor\RemoteIdIn, eZ\Publish\Core\Search\Elasticsearch\Content\Location\CriterionVisitor\ParentLocationIdIn, eZ\Publish\Core\Search\Elasticsearch\Content\Location\CriterionVisitor\ObjectStateIdIn, eZ\Publish\Core\Search\Elasticsearch\Content\Location\CriterionVisitor\LocationRemoteIdIn, eZ\Publish\Core\Search\Elasticsearch\Content\Location\CriterionVisitor\LocationIdIn, eZ\Publish\Core\Search\Elasticsearch\Content\Location\CriterionVisitor\Location\PriorityRange, eZ\Publish\Core\Search\Elasticsearch\Content\Location\CriterionVisitor\Location\PriorityIn, eZ\Publish\Core\Search\Elasticsearch\Content\Location\CriterionVisitor\Location\IsMainLocation, eZ\Publish\Core\Search\Elasticsearch\Content\Location\CriterionVisitor\Location\DepthRange, eZ\Publish\Core\Search\Elasticsearch\Content\Location\CriterionVisitor\Location\DepthIn, eZ\Publish\Core\Search\Elasticsearch\Content\Location\CriterionVisitor\LanguageCodeIn, eZ\Publish\Core\Search\Elasticsearch\Content\Location\CriterionVisitor\DateMetadata\PublishedRange, eZ\Publish\Core\Search\Elasticsearch\Content\Location\CriterionVisitor\DateMetadata\PublishedIn, eZ\Publish\Core\Search\Elasticsearch\Content\Location\CriterionVisitor\DateMetadata\ModifiedRange, eZ\Publish\Core\Search\Elasticsearch\Content\Location\CriterionVisitor\DateMetadata\ModifiedIn, eZ\Publish\Core\Search\Elasticsearch\Content\Location\CriterionVisitor\ContentTypeIdIn, eZ\Publish\Core\Search\Elasticsearch\Content\Location\CriterionVisitor\ContentTypeIdentifierIn, eZ\Publish\Core\Search\Elasticsearch\Content\Location\CriterionVisitor\ContentTypeGroupIdIn, eZ\Publish\Core\Search\Elasticsearch\Content\Location\CriterionVisitor\ContentIdIn, eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\Visibility, eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\UserMetadataIn, eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\SubtreeIn, eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\SectionIdIn, eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\RemoteIdIn, eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\ParentLocationIdIn, eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\ObjectStateIdIn, eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\LocationRemoteIdIn, eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\LocationIdIn, eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\LanguageCodeIn, eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\FullText, eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\Field\MapLocationDistanceRange, eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\Field\FieldRange, eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\Field\FieldIn, eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\DateMetadata\PublishedRange, eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\DateMetadata\PublishedIn, eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\DateMetadata\ModifiedRange, eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\DateMetadata\ModifiedIn, eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\CustomField\CustomFieldRange, eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\CustomField\CustomFieldIn, eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\ContentTypeIdIn, eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\ContentTypeIdentifierIn, eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\ContentTypeGroupIdIn, eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\ContentIdIn, eZ\Publish\Core\Search\Elasticsearch\Content\Common\CriterionVisitor\MatchNone, eZ\Publish\Core\Search\Elasticsearch\Content\Common\CriterionVisitor\MatchAll, eZ\Publish\Core\Search\Elasticsearch\Content\Common\CriterionVisitor\LogicalOr, eZ\Publish\Core\Search\Elasticsearch\Content\Common\CriterionVisitor\LogicalNot, and eZ\Publish\Core\Search\Elasticsearch\Content\Common\CriterionVisitor\LogicalAnd.

## ◆ getFilterRange()

eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor::getFilterRange | ( |  | $operator,
|  |  | $start,
|  |  | $end
| ) |  |
| protected

Get Elasticsearch range filter.

Start and end are optional, depending on the respective operator. Pass null in this case. The operator may be one of:

- case Operator::GT:
- case Operator::GTE:
- case Operator::LT:
- case Operator::LTE:
- case Operator::BETWEEN:

Exceptions

Definition at line 141 of file CriterionVisitor.php.

References eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\BETWEEN, eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\GT, eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\GTE, eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\LT, and eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\LTE.

Referenced by eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\DateMetadata\ModifiedRange\visitFilter(), eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\DateMetadata\PublishedRange\visitFilter(), eZ\Publish\Core\Search\Elasticsearch\Content\Location\CriterionVisitor\DateMetadata\ModifiedRange\visitFilter(), eZ\Publish\Core\Search\Elasticsearch\Content\Location\CriterionVisitor\DateMetadata\PublishedRange\visitFilter(), eZ\Publish\Core\Search\Elasticsearch\Content\Location\CriterionVisitor\Location\DepthRange\visitFilter(), and eZ\Publish\Core\Search\Elasticsearch\Content\Location\CriterionVisitor\Location\PriorityRange\visitFilter().

## ◆ getQueryRange()

eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor::getQueryRange | ( |  | $operator,
|  |  | $start,
|  |  | $end
| ) |  |
| protected

Get Elasticsearch range query.

Start and end are optional, depending on the respective operator. Pass null in this case. The operator may be one of:

- case Operator::GT:
- case Operator::GTE:
- case Operator::LT:
- case Operator::LTE:
- case Operator::BETWEEN:

Exceptions

Definition at line 80 of file CriterionVisitor.php.

References eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\BETWEEN, eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\GT, eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\GTE, eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\LT, eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\LTE, and eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\prepareValue().

Referenced by eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\CustomField\CustomFieldRange\getCondition(), and eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\Field\FieldRange\getCondition().

## ◆ prepareValue()

eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor::prepareValue | ( |  | $value | ) |
| protected

Converts given $value to the appropriate Elasticsearch representation.

The value will be converted to string representation and escaped if needed.

Parameters

  mixed | $value |

Returns
  string

Definition at line 196 of file CriterionVisitor.php.

Referenced by eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\getQueryRange().

## ◆ visitFilter()

eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor::visitFilter | ( | Criterion | $criterion,
|  | CriterionVisitorDispatcher | $dispatcher,
|  | array | $languageFilter
| ) |  |
| abstract

Map field value to a proper Elasticsearch filter representation.

Parameters

  \eZ\Publish\API\Repository\Values\Content\Query\Criterion | $criterion |
  \eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitorDispatcher | $dispatcher |
  array | $languageFilter |

Returns
  mixed Hash representation of Elasticsearch filter abstract syntax tree

Referenced by eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\visitQuery().

## ◆ visitQuery()

eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor::visitQuery | ( | Criterion | $criterion,
|  | CriterionVisitorDispatcher | $dispatcher,
|  | array | $languageFilter
| ) |  |

Map field value to a proper Elasticsearch query representation.

By default this method fallbacks on self::visitFilter(), override it as needed.

Parameters

  \eZ\Publish\API\Repository\Values\Content\Query\Criterion | $criterion |
  \eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitorDispatcher | $dispatcher |
  array | $languageFilter |

Returns
  mixed Hash representation of Elasticsearch query abstract syntax tree

Definition at line 55 of file CriterionVisitor.php.

References eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\visitFilter().

The documentation for this class was generated from the following file:

- CriterionVisitor.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.