class Locale extends BaseResource implements CreatableInterface

Locale class.

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

Traits

DeletableTrait.
UpdatableTrait.

Properties

SystemProperties $sys from UpdatableTrait
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

initialize(string $type, array $sys = [])

Initialize system properties.

getSystemProperties()

{@inheritdoc}

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()

Deletes the current resource.

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

Locale constructor.

array
jsonSerialize()

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

string[]
asUriParameters()

Returns an associate 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 39
protected initialize(string $type, array $sys = [])

Initialize system properties.

Parameters

string $type The system type
array $sys

in BaseResource at line 48
getSystemProperties()

{@inheritdoc}

in BaseResource at line 56
getId()

{@inheritdoc}

in BaseResource at line 64
getType()

{@inheritdoc}

{@inheritdoc}

at line 103
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 98
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 29
delete()

Deletes the current resource.

in UpdatableTrait at line 38
update()

Deletes the current resource.

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

Locale constructor.

Parameters

string $name
string $code
string $fallbackCode

at line 86
array jsonSerialize()

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

Return Value

array

at line 117
string[] asUriParameters()

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

Return Value

string[]

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

Return Value

string

at line 147
Locale setName(string $name)

Parameters

string $name

Return Value

Locale

at line 157
string getCode()

Return Value

string

at line 167
Locale setCode(string $code)

Parameters

string $code

Return Value

Locale

at line 177
string|null getFallbackCode()

Return Value

string|null

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

Parameters

string $fallbackCode

Return Value

Locale

at line 197
bool isContentDeliveryApi()

Return Value

bool

at line 207
Locale setContentDeliveryApi(bool $contentDeliveryApi)

Parameters

bool $contentDeliveryApi

Return Value

Locale

at line 217
bool isContentManagementApi()

Return Value

bool

at line 227
Locale setContentManagementApi(bool $contentManagementApi)

Parameters

bool $contentManagementApi

Return Value

Locale

at line 237
bool isDefault()

Return Value

bool

at line 245
bool isOptional()

Return Value

bool

at line 255
Locale setOptional(bool $optional)

Parameters

bool $optional

Return Value

Locale