Copied!

MultiLanguageDescription

MultiLanguageDescription.php : 17

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

Provides a uniform way for API consuming logic to generate translated description labels for API objects.

Methods

publicgetDescription()

MultiLanguageDescription.php : 43

Return the human readable description of the domain object in a given language.

public getDescription([string|null $languageCode = null ]) : string|null
  • If $languageCode is defined, return if available, otherwise null
  • If not, pick it using prioritized language (if provided to api on object retrieval), otherwise in main language

Parameters

Name Type Default value Description
$languageCode string|null null -

Return values

string|null

The description for a given language, or null if $languageCode is not set or does not exist.

publicgetDescriptions()

MultiLanguageDescription.php : 29

Return the human readable description in all provided languages.

public getDescriptions() : array<string|int, string>

The structure of the return value is: array( 'eng' => '<description_eng>', 'de' => '<description_de>' );

Return values

array<string|int, string>