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

Elasticsearch/Content/SortClauseVisitor/FieldBase.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\Search\Elasticsearch\Content\SortClauseVisitor;
8
9 use eZ\Publish\Core\Search\Elasticsearch\Content\SortClauseVisitor;
10 use eZ\Publish\API\Repository\Values\Content\Query\SortClause;
11 use eZ\Publish\Core\Search\Common\FieldNameResolver;
12
16 abstract class FieldBase extends SortClauseVisitor
17 {
23 protected $fieldNameResolver;
24
28 public function __construct(FieldNameResolver $fieldNameResolver)
29 {
30 $this->fieldNameResolver = $fieldNameResolver;
31 }
32
43 protected function getSortFieldName(
44 SortClause $sortClause,
45 $contentTypeIdentifier,
46 $fieldDefinitionIdentifier,
47 $name = null
48 ) {
49 return $this->fieldNameResolver->getSortFieldName(
50 $sortClause,
51 $contentTypeIdentifier,
52 $fieldDefinitionIdentifier,
53 $name
54 );
55 }
56
67 protected function getNestedFilterTerm($languageCode)
68 {
69 if ($languageCode === null) {
70 return [
71 'fields_doc.meta_is_main_translation_b' => true,
72 ];
73 }
74
75 return [
76 'fields_doc.meta_language_code_s' => $languageCode,
77 ];
78 }
79 }
eZ\Publish\API\Repository\Values\Content\Query\SortClause
This class is the base for SortClause classes, used to set sorting of content queries.
Definition: Content/Query/SortClause.php:16
eZ\Publish\Core\Search\Common\FieldNameResolver
Provides search backend field name resolving for criteria and sort clauses targeting Content fields.
Definition: FieldNameResolver.php:20
eZ\Publish\Core\Search\Elasticsearch\Content\SortClauseVisitor\FieldBase
Base class for Field sort clauses.
Definition: Elasticsearch/Content/SortClauseVisitor/FieldBase.php:17
eZ\Publish\Core\Search\Elasticsearch\Content\SortClauseVisitor\FieldBase\__construct
__construct(FieldNameResolver $fieldNameResolver)
Definition: Elasticsearch/Content/SortClauseVisitor/FieldBase.php:28
eZ\Publish\Core\Search\Elasticsearch\Content\SortClauseVisitor\FieldBase\$fieldNameResolver
$fieldNameResolver
Definition: Elasticsearch/Content/SortClauseVisitor/FieldBase.php:23
eZ\Publish\Core\Search\Elasticsearch\Content\SortClauseVisitor\FieldBase\getNestedFilterTerm
getNestedFilterTerm($languageCode)
Returns the term condition for nested filter, used to target specific nested field document.
Definition: Elasticsearch/Content/SortClauseVisitor/FieldBase.php:67
eZ\Publish\Core\Search\Elasticsearch\Content\SortClauseVisitor\FieldBase\getSortFieldName
getSortFieldName(SortClause $sortClause, $contentTypeIdentifier, $fieldDefinitionIdentifier, $name=null)
Get sort field name.
Definition: Elasticsearch/Content/SortClauseVisitor/FieldBase.php:43
eZ\Publish\Core\Search\Elasticsearch\Content\SortClauseVisitor
Visits the sort clause into a hash representation of Elasticsearch sort.
Definition: SortClauseVisitor.php:17
eZ\Publish\API\Repository\Values\Content\Query\SortClause
Definition: API/Repository/Values/Content/Query/SortClause/ContentId.php:7
eZ\Publish\Core\Search\Elasticsearch\Content\SortClauseVisitor
Definition: Search/Elasticsearch/Content/SortClauseVisitor/Aggregate.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.