class Space extends BaseProxy

Space class.

This class is used as a proxy for doing operations related to spaces.

Properties

protected Client $client from BaseProxy
protected string|null $spaceId from BaseProxy
protected $requiresSpaceId {@inheritdoc}

Methods

__construct(Client $client, string $spaceId = null)

BaseProxy constructor.

from BaseProxy
__call(string $name, array $arguments)

Acts as a whitelister for protected methods.

from BaseProxy
string|null
getBaseUri()

Returns the string to be used as baseUri option, or null otherwise.

from BaseProxy
resolveLink(Link $link)

Shortcut for resolving links.

from BaseProxy
ResourceInterface|ResourceArray
getResource(array $values, Query $query = null, ResourceInterface $resource = null)

No description

from BaseProxy
requestResource(string $method, string $uriSuffix, ResourceInterface|string $resource, int $version = null, mixed $body = null)

No description

from BaseProxy
string
getResourceId(ResourceInterface|string $resource)

No description

from BaseProxy
ResourceInterface
create(Space $resource, string $resourceId = null)

No description

string[]
getCreateAdditionalHeaders(ResourceInterface $resource)

Override this method in a proxy class if special headers are to be defined upon creation.

ResourceInterface
update(Space $resource)

No description

ResourceInterface
delete(Space|string $resource, int $version = null)

No description

archive(ResourceInterface|string $resource, int $version = null)

Archives a resource.

from BaseProxy
unarchive(ResourceInterface|string $resource, int $version = null)

Unarchives a resource.

from BaseProxy
publish(ResourceInterface|string $resource, int $version = null)

Publishes a resource.

from BaseProxy
unpublish(ResourceInterface|string $resource, int $version = null)

Unpublishes a resource.

from BaseProxy
string
getResourceUri(array $values)

Returns the URI for the current proxy type.

string[]
getEnabledMethods()

An array of enabled methods for the current proxy.

get(string $resourceId)

Returns a Space object which corresponds to the given resource ID in Contentful.

ResourceArray
getAll(Query $query = null)

Returns a ResourceArray object containing Space objects.

Details

in BaseProxy at line 54
__construct(Client $client, string $spaceId = null)

BaseProxy constructor.

Parameters

Client $client
string $spaceId

in BaseProxy at line 78
ResourceInterface __call(string $name, array $arguments)

Acts as a whitelister for protected methods.

Parameters

string $name
array $arguments

Return Value

ResourceInterface

Exceptions

LogicException

in BaseProxy at line 93
protected string|null getBaseUri()

Returns the string to be used as baseUri option, or null otherwise.

Return Value

string|null

Shortcut for resolving links.

Parameters

Link $link

Return Value

ResourceInterface

in BaseProxy at line 117
protected ResourceInterface|ResourceArray getResource(array $values, Query $query = null, ResourceInterface $resource = null)

Parameters

array $values
Query $query
ResourceInterface $resource

Return Value

ResourceInterface|ResourceArray

in BaseProxy at line 144
protected ResourceInterface requestResource(string $method, string $uriSuffix, ResourceInterface|string $resource, int $version = null, mixed $body = null)

Parameters

string $method
string $uriSuffix
ResourceInterface|string $resource
int $version
mixed $body

Return Value

ResourceInterface

in BaseProxy at line 172
protected string getResourceId(ResourceInterface|string $resource)

Parameters

ResourceInterface|string $resource

Return Value

string

at line 27
ResourceInterface create(Space $resource, string $resourceId = null)

Parameters

Space $resource
string $resourceId

Return Value

ResourceInterface

at line 53
protected string[] getCreateAdditionalHeaders(ResourceInterface $resource)

Override this method in a proxy class if special headers are to be defined upon creation.

Parameters

ResourceInterface $resource

Return Value

string[]

at line 27
ResourceInterface update(Space $resource)

Parameters

Space $resource

Return Value

ResourceInterface

at line 27
ResourceInterface delete(Space|string $resource, int $version = null)

Parameters

Space|string $resource
int $version

Return Value

ResourceInterface

in BaseProxy at line 248
protected archive(ResourceInterface|string $resource, int $version = null)

Archives a resource.

Parameters

ResourceInterface|string $resource Either a resource object, or a resource ID
int $version Null if $resouce is an object

in BaseProxy at line 263
protected unarchive(ResourceInterface|string $resource, int $version = null)

Unarchives a resource.

Parameters

ResourceInterface|string $resource Either a resource object, or a resource ID
int $version Null if $resouce is an object

in BaseProxy at line 278
protected publish(ResourceInterface|string $resource, int $version = null)

Publishes a resource.

Parameters

ResourceInterface|string $resource Either a resource object, or a resource ID
int $version Null if $resouce is an object

in BaseProxy at line 293
protected unpublish(ResourceInterface|string $resource, int $version = null)

Unpublishes a resource.

Parameters

ResourceInterface|string $resource Either a resource object, or a resource ID
int $version Null if $resouce is an object

at line 37
protected string getResourceUri(array $values)

Returns the URI for the current proxy type.

Parameters

array $values

Return Value

string

at line 45
string[] getEnabledMethods()

An array of enabled methods for the current proxy.

Return Value

string[]

at line 67
Space get(string $resourceId)

Returns a Space object which corresponds to the given resource ID in Contentful.

Parameters

string $resourceId

Return Value

Space

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/spaces/space

at line 83
ResourceArray getAll(Query $query = null)

Returns a ResourceArray object containing Space objects.

Parameters

Query $query

Return Value

ResourceArray

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/spaces/spaces-collection