For generic use, expects method exposing translated property as-is on value object, typically $object->$method($language)
Languages will consist of either forced language or current languages list, in addition helper will append null
to list of languages so method may fallback to main/initial language if supported by domain.
public getTranslatedByMethod ( eZ\Publish\API\Repository\Values\ValueObject $object, string $method, string $forcedLanguage = null ) : string | null | ||
$object | eZ\Publish\API\Repository\Values\ValueObject | Can be any kind of Value object which directly holds the methods that provides translated value. |
$method | string | Method name, example 'getName', 'description' |
$forcedLanguage | string | Locale we want the content name translation in (e.g. "fre-FR"). Null by default (takes current locale) |
return | string | null |