class Locale extends BaseResource implements Creatable, Updatable, Deletable

Locale class.

This class represents a resource with type "Locale" in Contentful.

Properties

protected SystemProperties $sys from BaseResource
protected BaseProxy $proxy from BaseResource
protected string $name
protected string $code
protected string|null $fallbackCode
protected bool $contentDeliveryApi
protected bool $contentManagementApi
protected bool $default
protected bool $optional

Methods

__construct(string $name, string $code, string $fallbackCode = null)

Locale constructor.

getSystemProperties()

Returns the resource's system properties, defined in the object "sys" in Contentful's responses.

string|null
getId()

Shortcut for accessing the resource ID through its system properties.

Link
asLink()

Creates a Link representation of the current resource.

setProxy(BaseProxy $proxy)

Sets the current BaseProxy object instance.

asRequestBody()

{@inheritdoc}

__call(string $name, array $arguments)

Shortcut for forwarding methods to the current proxy, using the current object as argument.

array
jsonSerialize()

Returns an array to be used by "json_encode" to serialize objects of this class.

string
getName()

No description

setName(string $name)

No description

string
getCode()

No description

setCode(string $code)

No description

string|null
getFallbackCode()

No description

setFallbackCode(string $fallbackCode = null)

No description

bool
isContentDeliveryApi()

No description

setContentDeliveryApi(bool $contentDeliveryApi)

No description

bool
isContentManagementApi()

No description

setContentManagementApi(bool $contentManagementApi)

No description

bool
isDefault()

No description

bool
isOptional()

No description

setOptional(bool $optional)

No description

Details

at line 69
__construct(string $name, string $code, string $fallbackCode = null)

Locale constructor.

Parameters

string $name
string $code
string $fallbackCode

in BaseResource at line 47
SystemProperties getSystemProperties()

Returns the resource's system properties, defined in the object "sys" in Contentful's responses.

Return Value

SystemProperties

in BaseResource at line 57
string|null getId()

Shortcut for accessing the resource ID through its system properties.

Return Value

string|null

Creates a Link representation of the current resource.

Return Value

Link

in BaseResource at line 79
BaseResource setProxy(BaseProxy $proxy)

Sets the current BaseProxy object instance.

This is done automatically when performing API calls, so it shouldn't be used manually.

Parameters

BaseProxy $proxy

Return Value

BaseResource

at line 99
asRequestBody()

{@inheritdoc}

in BaseResource at line 111
__call(string $name, array $arguments)

Shortcut for forwarding methods to the current proxy, using the current object as argument.

// Instead of
$client->asset->publish($asset);
// You can use
$asset->publish();

Parameters

string $name
array $arguments

at line 82
array jsonSerialize()

Returns an array to be used by "json_encode" to serialize objects of this class.

Return Value

array

at line 113
string getName()

Return Value

string

at line 123
Locale setName(string $name)

Parameters

string $name

Return Value

Locale

at line 133
string getCode()

Return Value

string

at line 143
Locale setCode(string $code)

Parameters

string $code

Return Value

Locale

at line 153
string|null getFallbackCode()

Return Value

string|null

at line 163
Locale setFallbackCode(string $fallbackCode = null)

Parameters

string $fallbackCode

Return Value

Locale

at line 173
bool isContentDeliveryApi()

Return Value

bool

at line 183
Locale setContentDeliveryApi(bool $contentDeliveryApi)

Parameters

bool $contentDeliveryApi

Return Value

Locale

at line 193
bool isContentManagementApi()

Return Value

bool

at line 203
Locale setContentManagementApi(bool $contentManagementApi)

Parameters

bool $contentManagementApi

Return Value

Locale

at line 213
bool isDefault()

Return Value

bool

at line 221
bool isOptional()

Return Value

bool

at line 231
Locale setOptional(bool $optional)

Parameters

bool $optional

Return Value

Locale