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

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

Generator for search backend field names. More...

## Public Member Functions
| __construct (array $fieldNameMapping)
| getName ($name, $field=null, $type=null)
| Get name for document field. More...
| getTypedName ($name, FieldType $type)
| Map field type. More...

## Protected Attributes
| $fieldNameMapping

## Detailed Description

Generator for search backend field names.

Definition at line 14 of file FieldNameGenerator.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\Search\Common\FieldNameGenerator::__construct | ( | array | $fieldNameMapping | ) |

Definition at line 40 of file FieldNameGenerator.php.

References eZ\Publish\Core\Search\Common\FieldNameGenerator\$fieldNameMapping.

## Member Function Documentation

## ◆ getName()

eZ\Publish\Core\Search\Common\FieldNameGenerator::getName | ( |  | $name,
|  |  | $field = `null`,
|  |  | $type = `null`
| ) |  |

Get name for document field.

Consists of a name, and optionally field name and a content type name.

Parameters

  string | $name |
  string | null | $field |
  string | null | $type |

Returns
  string

Definition at line 56 of file FieldNameGenerator.php.

## ◆ getTypedName()

eZ\Publish\Core\Search\Common\FieldNameGenerator::getTypedName | ( |  | $name,
|  | FieldType | $type
| ) |  |

Map field type.

For indexing backend the following scheme will always be used for names: {name}_{type}.

Using dynamic fields this allows to define fields either depending on types, or names.

Only the field with the name 'id' remains untouched.

Parameters

  string | $name |
  \eZ\Publish\SPI\Search\FieldType | $type |

Returns
  string

Definition at line 77 of file FieldNameGenerator.php.

## Member Data Documentation

## ◆ $fieldNameMapping

eZ\Publish\Core\Search\Common\FieldNameGenerator::$fieldNameMapping
| protected

Definition at line 38 of file FieldNameGenerator.php.

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

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

- FieldNameGenerator.php

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