MultiLanguageName
MultiLanguageName.php
:
18
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.
Methods¶
getName() ¶
MultiLanguageName.php
:
47
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:
- Prioritized languages (if provided to api on object retrieval)
- Main language if object is $alwaysAvailable
- Fallback to return in initial (version objects) or main language
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$languageCode | string|null | null | - |
Return values
string|null
The name for a given language, or null if $languageCode is not set or does not exist.
getNames() ¶
MultiLanguageName.php
:
30
Return the human readable name in all provided languages.
|
|
The structure of the return value is:
array( 'eng' => '<name_eng>', 'de' => '<name_de>' );
Return values
array<string|int, string>