class Extension extends BaseResource implements Creatable, Updatable, Deletable

Extension class.

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

Properties

protected SystemProperties $sys from BaseResource
protected BaseProxy $proxy from BaseResource
protected string $name
protected string $source
protected FieldType $fieldTypes
protected bool $sidebar

Methods

__construct(string $name = '')

Extension construct.

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.

string
getName()

No description

setName(string $name)

No description

string
getSource()

No description

setSource(string $source)

No description

getFieldTypes()

No description

setFieldTypes(array $fieldTypes)

No description

addFieldType(FieldType $fieldType)

No description

bool
isSidebar()

No description

setSidebar(bool $sidebar)

No description

array
jsonSerialize()

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

void
update()

No description

void
delete()

No description

Details

at line 56
__construct(string $name = '')

Extension construct.

Parameters

string $name

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

in BaseResource at line 89
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 66
string getName()

Return Value

string

at line 76
Extension setName(string $name)

Parameters

string $name

Return Value

Extension

at line 86
string getSource()

Return Value

string

at line 96
Extension setSource(string $source)

Parameters

string $source Either the full extension code, or an URL

Return Value

Extension

at line 106
FieldType[] getFieldTypes()

Return Value

FieldType[]

at line 116
Extension setFieldTypes(array $fieldTypes)

Parameters

array $fieldTypes

Return Value

Extension

at line 132
Extension addFieldType(FieldType $fieldType)

Parameters

FieldType $fieldType

Return Value

Extension

at line 142
bool isSidebar()

Return Value

bool

at line 152
Extension setSidebar(bool $sidebar)

Parameters

bool $sidebar

Return Value

Extension

at line 164
array jsonSerialize()

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

Return Value

array

at line 29
void update()

Return Value

void

at line 29
void delete()

Return Value

void