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

Public Member Functions | List of all members
eZ\Publish\SPI\Repository\Values\MultiLanguageName Interface Reference

This is the interface for all ValueObjects implementing translated name logic. More...

Inheritance diagram for eZ\Publish\SPI\Repository\Values\MultiLanguageName:

## Public Member Functions
| getNames ()
| Return the human readable name in all provided languages. More...
| getName ($languageCode=null)
| Return the name of the domain object in a given language. More...

## Detailed Description

This is the interface for all ValueObjects implementing translated name logic.

Provides a uniform way for API consuming logic to generate translated names / labels for API objects. Language logic is meant to also be used for description, fields, ... lookup as well.

Todo:
  Move to API, Repository is not a SPI concept.

Definition at line 18 of file MultiLanguageName.php.

## Member Function Documentation

## ◆ getName()

eZ\Publish\SPI\Repository\Values\MultiLanguageName::getName | ( |  | $languageCode = `null` | ) |

Return the name of the domain object in a given language.

- If $languageCode is defined, return if available, otherwise null
- If not, pick using the following languages codes when applicable:
  1. Prioritized languages (if provided to api on object retrieval)
  2. Main language if object is $alwaysAvailable
  3. Fallback to return in initial (version objects) or main language

Parameters

  string | null | $languageCode |

Returns
  string|null The name for a given language, or null if $languageCode is not set or does not exist.

Implemented in eZ\Publish\Core\REST\Client\Values\ContentType\FieldDefinition, eZ\Publish\Core\REST\Client\Values\ContentType\ContentTypeGroup, eZ\Publish\Core\REST\Client\Values\ContentType\ContentTypeDraft, eZ\Publish\Core\REST\Client\Values\Content\VersionInfo, eZ\Publish\Core\Repository\Values\ContentType\ContentTypeGroupProxy, eZ\Publish\Core\Repository\Values\ContentType\ContentTypeDraft, and eZ\Publish\Core\Repository\Values\Content\VersionInfo.

Referenced by eZ\Publish\Core\Helper\TranslationHelper\getTranslatedContentNameByVersionInfo().

## ◆ getNames()

eZ\Publish\SPI\Repository\Values\MultiLanguageName::getNames | ( |  | ) |

Return the human readable name in all provided languages.

The structure of the return value is: `array( 'eng' => '<name_eng>', 'de' => '<name_de>' );`

Returns
  string[]

Implemented in eZ\Publish\Core\REST\Client\Values\ContentType\FieldDefinition, eZ\Publish\Core\REST\Client\Values\ContentType\ContentTypeGroup, eZ\Publish\Core\REST\Client\Values\ContentType\ContentTypeDraft, eZ\Publish\Core\REST\Client\Values\Content\VersionInfo, eZ\Publish\Core\Repository\Values\ContentType\ContentTypeGroupProxy, eZ\Publish\Core\Repository\Values\ContentType\ContentTypeDraft, and eZ\Publish\Core\Repository\Values\Content\VersionInfo.

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

- MultiLanguageName.php

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