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.

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

in BaseResource at line 37
getId()

{@inheritdoc}

in BaseResource at line 45
getType()

{@inheritdoc}

{@inheritdoc}

at line 115
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 79
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 90
getSystemProperties()

{@inheritdoc}

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

Locale constructor.

Parameters

string $name
string $code
string $fallbackCode

at line 98
jsonSerialize()

{@inheritdoc}

at line 129
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 141
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 149
string getName()

Return Value

string

at line 159
Locale setName(string $name)

Parameters

string $name

Return Value

Locale

at line 169
string getCode()

Return Value

string

at line 179
Locale setCode(string $code)

Parameters

string $code

Return Value

Locale

at line 189
string|null getFallbackCode()

Return Value

string|null

at line 199
Locale setFallbackCode(string $fallbackCode = \null)

Parameters

string $fallbackCode

Return Value

Locale

at line 209
bool isContentDeliveryApi()

Return Value

bool

at line 219
Locale setContentDeliveryApi(bool $contentDeliveryApi)

Parameters

bool $contentDeliveryApi

Return Value

Locale

at line 229
bool isContentManagementApi()

Return Value

bool

at line 239
Locale setContentManagementApi(bool $contentManagementApi)

Parameters

bool $contentManagementApi

Return Value

Locale

at line 249
bool isDefault()

Return Value

bool

at line 257
bool isOptional()

Return Value

bool

at line 267
Locale setOptional(bool $optional)

Parameters

bool $optional

Return Value

Locale