class Locale extends BaseResource implements CreatableInterface

Locale class.

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

Traits

DeletableTrait.
UpdatableTrait.

Properties

protected Locale $sys
Client $client from UpdatableTrait
protected string $name
protected string $code
protected string|null $fallbackCode
protected bool $contentDeliveryApi
protected bool $contentManagementApi
protected bool $default
protected bool $optional

Methods

getId()

{@inheritdoc}

getType()

{@inheritdoc}

asLink()

{@inheritdoc}

mixed
asRequestBody()

Returns the resource in the form of request body.

setClient(Client $client)

Sets the current Client object instance.

delete()

Deletes the current resource.

update()

Updates the current resource.

getSystemProperties()

{@inheritdoc}

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

Locale constructor.

jsonSerialize()

{@inheritdoc}

string[]
asUriParameters()

Returns an associative array where keys are the name of the fragments in a URI, and the values are the corresponding IDs.

string[]
getHeadersForCreation()

Returns an array of headers that the current resource needs to sent for being created.

getName()

No description

setName(string $name)

No description

getCode()

No description

setCode(string $code)

No description

string|null
getFallbackCode()

No description

setFallbackCode(string $fallbackCode = null)

No description

isContentDeliveryApi()

No description

setContentDeliveryApi(bool $contentDeliveryApi)

No description

isContentManagementApi()

No description

setContentManagementApi(bool $contentManagementApi)

No description

isDefault()

No description

isOptional()

No description

setOptional(bool $optional)

No description

Details

in BaseResource at line 37
getId()

{@inheritdoc}

in BaseResource at line 45
getType()

{@inheritdoc}

{@inheritdoc}

at line 112
mixed asRequestBody()

Returns the resource in the form of request body.

This can differ from regular serialization, as some fields may not be present in the request payload.

Return Value

mixed

in BaseResource at line 77
BaseResource setClient(Client $client)

Sets the current Client object instance.

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

Parameters

Client $client

Return Value

BaseResource

in DeletableTrait at line 28
delete()

Deletes the current resource.

in UpdatableTrait at line 40
update()

Updates the current resource.

at line 87
getSystemProperties()

{@inheritdoc}

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

Locale constructor.

Parameters

string $name
string $code
string $fallbackCode

at line 95
jsonSerialize()

{@inheritdoc}

at line 126
string[] asUriParameters()

Returns an associative array where keys are the name of the fragments in a URI, and the values are the corresponding IDs.

Return Value

string[]

at line 138
string[] getHeadersForCreation()

Returns an array of headers that the current resource needs to sent for being created.

This method is supposed to be overridden if necessary.

Return Value

string[]

at line 143
getName()

at line 151
Locale setName(string $name)

Parameters

string $name

Return Value

Locale

at line 158
getCode()

at line 166
Locale setCode(string $code)

Parameters

string $code

Return Value

Locale

at line 176
string|null getFallbackCode()

Return Value

string|null

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

Parameters

string $fallbackCode

Return Value

Locale

at line 191
isContentDeliveryApi()

at line 199
Locale setContentDeliveryApi(bool $contentDeliveryApi)

Parameters

bool $contentDeliveryApi

Return Value

Locale

at line 206
isContentManagementApi()

at line 214
Locale setContentManagementApi(bool $contentManagementApi)

Parameters

bool $contentManagementApi

Return Value

Locale

at line 221
isDefault()

at line 226
isOptional()

at line 234
Locale setOptional(bool $optional)

Parameters

bool $optional

Return Value

Locale