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 111
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 86
getSystemProperties()

{@inheritdoc}

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

Locale constructor.

Parameters

string $name
string $code
string $fallbackCode

at line 94
jsonSerialize()

{@inheritdoc}

at line 125
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 137
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 142
getName()

at line 150
Locale setName(string $name)

Parameters

string $name

Return Value

Locale

at line 157
getCode()

at line 165
Locale setCode(string $code)

Parameters

string $code

Return Value

Locale

at line 175
string|null getFallbackCode()

Return Value

string|null

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

Parameters

string $fallbackCode

Return Value

Locale

at line 190
isContentDeliveryApi()

at line 198
Locale setContentDeliveryApi(bool $contentDeliveryApi)

Parameters

bool $contentDeliveryApi

Return Value

Locale

at line 205
isContentManagementApi()

at line 213
Locale setContentManagementApi(bool $contentManagementApi)

Parameters

bool $contentManagementApi

Return Value

Locale

at line 220
isDefault()

at line 225
isOptional()

at line 233
Locale setOptional(bool $optional)

Parameters

bool $optional

Return Value

Locale