class Asset extends BaseProxy

Asset class.

Properties

protected Client $client from BaseProxy
protected string|null $spaceId from BaseProxy
protected bool $requiresSpaceId Whether the current proxy requires a space ID for working properly. from BaseProxy

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(Asset $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.

from BaseProxy
ResourceInterface
update(Asset $resource)

No description

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

No description

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

No description

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

No description

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

No description

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

No description

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 an Asset object which corresponds to the given resource ID in Contentful.

ResourceArray
getAll(Query $query = null)

Returns a ResourceArray object containing Asset objects.

process(Asset $resource, string $locale = null)

No description

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 28
ResourceInterface create(Asset $resource, string $resourceId = null)

Parameters

Asset $resource
string $resourceId

Return Value

ResourceInterface

in BaseProxy at line 212
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 28
ResourceInterface update(Asset $resource)

Parameters

Asset $resource

Return Value

ResourceInterface

at line 28
ResourceInterface delete(Asset|string $resource, int $version = null)

Parameters

Asset|string $resource
int $version

Return Value

ResourceInterface

at line 28
ResourceInterface archive(Asset|string $resource, int $version = null)

Parameters

Asset|string $resource
int $version

Return Value

ResourceInterface

at line 28
ResourceInterface unarchive(Asset|string $resource, int $version = null)

Parameters

Asset|string $resource
int $version

Return Value

ResourceInterface

at line 28
ResourceInterface publish(Asset|string $resource, int $version = null)

Parameters

Asset|string $resource
int $version

Return Value

ResourceInterface

at line 28
ResourceInterface unpublish(Asset|string $resource, int $version = null)

Parameters

Asset|string $resource
int $version

Return Value

ResourceInterface

at line 33
protected string getResourceUri(array $values)

Returns the URI for the current proxy type.

Parameters

array $values

Return Value

string

at line 41
string[] getEnabledMethods()

An array of enabled methods for the current proxy.

Return Value

string[]

at line 55
Asset get(string $resourceId)

Returns an Asset object which corresponds to the given resource ID in Contentful.

Parameters

string $resourceId

Return Value

Asset

See also

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

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

Returns a ResourceArray object containing Asset objects.

Parameters

Query $query

Return Value

ResourceArray

See also

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

at line 84
process(Asset $resource, string $locale = null)

Parameters

Asset $resource
string $locale

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/assets/asset-processing