For generic use, expects array property as-is on value object, typically $object->$property[$language]
Languages will consist of either forced language or current languages list, in addition helper will check if for
mainLanguage property and append that to languages if alwaysAvailable property is true or non-existing.
public getTranslatedByProperty ( eZ\Publish\API\Repository\Values\ValueObject $object, string $property, string $forcedLanguage = null ) : string | null | ||
$object | eZ\Publish\API\Repository\Values\ValueObject | Can be any kid of Value object which directly holds the translated property |
$property | string | Property name, example 'names', 'descriptions' |
$forcedLanguage | string | Locale we want the content name translation in (e.g. "fre-FR"). Null by default (takes current locale) |
return | string | null |