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

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
eZ\Publish\Core\Search\Common\FieldNameResolver Class Reference

Provides search backend field name resolving for criteria and sort clauses targeting Content fields. More...

## Public Member Functions
| __construct (FieldRegistry $fieldRegistry, ContentTypeHandler $contentTypeHandler, FieldNameGenerator $nameGenerator)
| Create from search field registry, content type handler and field name generator. More...
| getFieldNames (Criterion $criterion, $fieldDefinitionIdentifier, $fieldTypeIdentifier=null, $name=null)
| For the given parameters returns a set of search backend field names to search on. More...
| getFieldTypes (Criterion $criterion, $fieldDefinitionIdentifier, $fieldTypeIdentifier=null, $name=null)
| For the given parameters returns a set of search backend field names/types to search on. More...
| getSortFieldName (SortClause $sortClause, $contentTypeIdentifier, $fieldDefinitionIdentifier, $name=null)
| For the given parameters returns search backend field name to sort on or null if the field could not be found. More...
| getIndexFieldName ( $criterionOrSortClause, $contentTypeIdentifier, $fieldDefinitionIdentifier, $fieldTypeIdentifier, $name, $isSortField)
| Returns index field name for the given parameters. More...

## Protected Member Functions
| getSearchableFieldMap ()
| Get content type, field definition and field type mapping information. More...

## Protected Attributes
| $fieldRegistry
| $contentTypeHandler
| $nameGenerator

## Detailed Description

Provides search backend field name resolving for criteria and sort clauses targeting Content fields.

Definition at line 19 of file FieldNameResolver.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\Search\Common\FieldNameResolver::__construct | ( | FieldRegistry | $fieldRegistry,
|  | ContentTypeHandler | $contentTypeHandler,
|  | FieldNameGenerator | $nameGenerator
| ) |  |

Create from search field registry, content type handler and field name generator.

Parameters

  \eZ\Publish\Core\Search\Common\FieldRegistry | $fieldRegistry |
  \eZ\Publish\SPI\Persistence\Content\Type\Handler | $contentTypeHandler |
  \eZ\Publish\Core\Search\Common\FieldNameGenerator | $nameGenerator |

Definition at line 49 of file FieldNameResolver.php.

References eZ\Publish\Core\Search\Common\FieldNameResolver\$contentTypeHandler, eZ\Publish\Core\Search\Common\FieldNameResolver\$fieldRegistry, and eZ\Publish\Core\Search\Common\FieldNameResolver\$nameGenerator.

## Member Function Documentation

## ◆ getFieldNames()

eZ\Publish\Core\Search\Common\FieldNameResolver::getFieldNames | ( | Criterion | $criterion,
|  |  | $fieldDefinitionIdentifier,
|  |  | $fieldTypeIdentifier = `null`,
|  |  | $name = `null`
| ) |  |

For the given parameters returns a set of search backend field names to search on.

The method will check for custom fields if given $criterion implements CustomFieldInterface. With optional parameters $fieldTypeIdentifier and $name specific field type and field from its Indexable implementation can be targeted.

Deprecated:
  since 6.2, use getFieldTypes instead

See also
  \eZ\Publish\API\Repository\Values\Content\Query\CustomFieldInterface
  \eZ\Publish\SPI\FieldType\Indexable

Parameters

  \eZ\Publish\API\Repository\Values\Content\Query\Criterion | $criterion |
  string | $fieldDefinitionIdentifier |
  string | null | $fieldTypeIdentifier |
  string | null | $name |

Returns
  string[]

Definition at line 103 of file FieldNameResolver.php.

References eZ\Publish\Core\Search\Common\FieldNameResolver\getFieldTypes().

## ◆ getFieldTypes()

eZ\Publish\Core\Search\Common\FieldNameResolver::getFieldTypes | ( | Criterion | $criterion,
|  |  | $fieldDefinitionIdentifier,
|  |  | $fieldTypeIdentifier = `null`,
|  |  | $name = `null`
| ) |  |

For the given parameters returns a set of search backend field names/types to search on.

The method will check for custom fields if given $criterion implements CustomFieldInterface. With optional parameters $fieldTypeIdentifier and $name specific field type and field from its Indexable implementation can be targeted.

See also
  \eZ\Publish\API\Repository\Values\Content\Query\CustomFieldInterface
  \eZ\Publish\SPI\FieldType\Indexable

Parameters

  \eZ\Publish\API\Repository\Values\Content\Query\Criterion | $criterion |
  string | $fieldDefinitionIdentifier |
  string | null | $fieldTypeIdentifier |
  string | null | $name |

Returns
  array<string, \eZ\Publish\SPI\Search\FieldType>

Definition at line 132 of file FieldNameResolver.php.

References eZ\Publish\Core\Search\Common\FieldNameResolver\getIndexFieldName(), and eZ\Publish\Core\Search\Common\FieldNameResolver\getSearchableFieldMap().

Referenced by eZ\Publish\Core\Search\Common\FieldNameResolver\getFieldNames().

## ◆ getIndexFieldName()

eZ\Publish\Core\Search\Common\FieldNameResolver::getIndexFieldName | ( |  | $criterionOrSortClause,
|  |  | $contentTypeIdentifier,
|  |  | $fieldDefinitionIdentifier,
|  |  | $fieldTypeIdentifier,
|  |  | $name,
|  |  | $isSortField
| ) |  |

Returns index field name for the given parameters.

Parameters

  object | $criterionOrSortClause |
  string | $contentTypeIdentifier |
  string | $fieldDefinitionIdentifier |
  string | $fieldTypeIdentifier |
  string | $name |
  bool | $isSortField |

Returns
  string

Definition at line 230 of file FieldNameResolver.php.

References eZ\Publish\API\Repository\Values\Content\Query\CustomFieldInterface\getCustomField().

Referenced by eZ\Publish\Core\Search\Common\FieldNameResolver\getFieldTypes(), and eZ\Publish\Core\Search\Common\FieldNameResolver\getSortFieldName().

## ◆ getSearchableFieldMap()

eZ\Publish\Core\Search\Common\FieldNameResolver::getSearchableFieldMap | ( |  | ) |
| protected

Get content type, field definition and field type mapping information.

Returns an array in the form:

`array( "<ContentType identifier>" => array( "<FieldDefinition identifier>" => array( "field_definition_id" => "<FieldDefinition id>", "field_type_identifier" => "<FieldType identifier>", ), ... ), ... )`

Returns
  array[]

Definition at line 79 of file FieldNameResolver.php.

Referenced by eZ\Publish\Core\Search\Common\FieldNameResolver\getFieldTypes(), and eZ\Publish\Core\Search\Common\FieldNameResolver\getSortFieldName().

## ◆ getSortFieldName()

eZ\Publish\Core\Search\Common\FieldNameResolver::getSortFieldName | ( | SortClause | $sortClause,
|  |  | $contentTypeIdentifier,
|  |  | $fieldDefinitionIdentifier,
|  |  | $name = `null`
| ) |  |

For the given parameters returns search backend field name to sort on or null if the field could not be found.

The method will check for custom fields if given $sortClause implements CustomFieldInterface. With optional parameter $name specific field from field type's Indexable implementation can be targeted.

Will return null if no sortable field is found.

See also
  \eZ\Publish\API\Repository\Values\Content\Query\CustomFieldInterface
  \eZ\Publish\SPI\FieldType\Indexable

Parameters

  \eZ\Publish\API\Repository\Values\Content\Query\SortClause | $sortClause |
  string | $contentTypeIdentifier |
  string | $fieldDefinitionIdentifier |
  string | null | $name |

Returns
  string|null

Definition at line 193 of file FieldNameResolver.php.

References eZ\Publish\Core\Search\Common\FieldNameResolver\getIndexFieldName(), and eZ\Publish\Core\Search\Common\FieldNameResolver\getSearchableFieldMap().

## Member Data Documentation

## ◆ $contentTypeHandler

eZ\Publish\Core\Search\Common\FieldNameResolver::$contentTypeHandler
| protected

Definition at line 33 of file FieldNameResolver.php.

Referenced by eZ\Publish\Core\Search\Common\FieldNameResolver\__construct().

## ◆ $fieldRegistry

eZ\Publish\Core\Search\Common\FieldNameResolver::$fieldRegistry
| protected

Definition at line 26 of file FieldNameResolver.php.

Referenced by eZ\Publish\Core\Search\Common\FieldNameResolver\__construct().

## ◆ $nameGenerator

eZ\Publish\Core\Search\Common\FieldNameResolver::$nameGenerator
| protected

Definition at line 40 of file FieldNameResolver.php.

Referenced by eZ\Publish\Core\Search\Common\FieldNameResolver\__construct().

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

- FieldNameResolver.php

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