LocalizedResource
class LocalizedResource extends BaseResource
A LocalizedResource can store information for multiple locales.
The methods in this base class allow switching between the locales.
Properties
protected string[] | $localeCodes | List of codes for all the locales available in the space this resource belongs to. | |
LocalizedResource | $sys |
Methods
Resources in this SDK should not be built using $new Class()
.
No description
The locale code for the currently set locale.
Details
in BaseResource at line 24
protected
__construct(array $data)
Resources in this SDK should not be built using $new Class()
.
This method is only useful in testing environments, where the resource needs to be subclasses and this method made public.
in BaseResource at line 36
asLink()
{@inheritdoc}
in BaseResource at line 47
getId()
{@inheritdoc}
in BaseResource at line 55
getType()
{@inheritdoc}
at line 41
initLocales(array $locales)
at line 65
$this
setLocale(Locale|string $locale)
Set the locale for this instance.
All future calls to a getter will return the information for this locale.
at line 77
getLocale()
The locale code for the currently set locale.
It will be either the default locale if the resource was fetched using "locale=*", or the one that was used in the API request.