Class

eZ\Publish\Core\Search\Common\FieldNameResolver

class FieldNameResolver

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

Methods

__construct(FieldRegistry $fieldRegistry, Handler $contentTypeHandler, FieldNameGenerator $nameGenerator)

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

string[] getFieldNames(Criterion $criterion, string $fieldDefinitionIdentifier, null|string $fieldTypeIdentifier = null, null|string $name = null)

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

array<string, getFieldTypes(Criterion $criterion, string $fieldDefinitionIdentifier, null|string $fieldTypeIdentifier = null, null|string $name = null)

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

null|string getSortFieldName(SortClause $sortClause, string $contentTypeIdentifier, string $fieldDefinitionIdentifier, null|string $name = null)

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

string getIndexFieldName(object $criterionOrSortClause, string $contentTypeIdentifier, string $fieldDefinitionIdentifier, string $fieldTypeIdentifier, string $name, bool $isSortField)

Returns index field name for the given parameters.

Details

at line 51
public __construct(FieldRegistry $fieldRegistry, Handler $contentTypeHandler, FieldNameGenerator $nameGenerator)

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

Parameters

FieldRegistry $fieldRegistry
Handler $contentTypeHandler
FieldNameGenerator $nameGenerator

at line 106
public string[] getFieldNames(Criterion $criterion, string $fieldDefinitionIdentifier, null|string $fieldTypeIdentifier = null, null|string $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.

Parameters

Criterion $criterion
string $fieldDefinitionIdentifier
null|string $fieldTypeIdentifier
null|string $name

Return Value

string[]

See also

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

at line 135
public array<string, getFieldTypes(Criterion $criterion, string $fieldDefinitionIdentifier, null|string $fieldTypeIdentifier = null, null|string $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.

Parameters

Criterion $criterion
string $fieldDefinitionIdentifier
null|string $fieldTypeIdentifier
null|string $name

Return Value

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

See also

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

at line 196
public null|string getSortFieldName(SortClause $sortClause, string $contentTypeIdentifier, string $fieldDefinitionIdentifier, null|string $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.

Parameters

SortClause $sortClause
string $contentTypeIdentifier
string $fieldDefinitionIdentifier
null|string $name

Return Value

null|string

See also

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

at line 233
public string getIndexFieldName(object $criterionOrSortClause, string $contentTypeIdentifier, string $fieldDefinitionIdentifier, string $fieldTypeIdentifier, string $name, bool $isSortField)

Returns index field name for the given parameters.

Parameters

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

Return Value

string