interface ClientInterface implements ScopedClientInterface

ClientInterface.

This interface should be used whenever referring to a client object instance, as it decouples the method signatures from the actual implementation.

It provides definitions for all methods which return API resources.

Methods

string
getApi()

Returns a string representation of the API currently in use.

string
getSpaceId()

Returns the ID of the space currently in use.

string
getEnvironmentId()

Returns the ID of the environment currently in use.

getAsset(string $assetId, string $locale = \null)

Returns a single Asset object corresponding to the given ID.

ResourceArray|Asset[]
getAssets(Query $query = \null)

Returns a collection of Asset objects wrapped in a ResourceArray instance.

getContentType(string $contentTypeId)

Returns a single ContentType object corresponding to the given ID.

ResourceArray|ContentType[]
getContentTypes(Query $query = \null)

Returns a collection of ContentType objects wrapped in a ResourceArray instance.

getEnvironment()

Returns the Environment object corresponding to the one in use.

getEntry(string $entryId, string $locale = \null)

Returns a single Entry object corresponding to the given ID.

ResourceArray|Entry[]
getEntries(Query $query = \null)

Returns a collection of Entry objects wrapped in a ResourceArray instance.

getSpace()

Returns the Space object corresponding to the one in use.

ResourceInterface
resolveLink(Link $link, string $locale = \null)

Resolve a link to its actual resource.

ResourceInterface[]
resolveLinkCollection(array $links, string $locale = \null)

Resolves an array of links.

Details

in ScopedClientInterface at line 21
string getApi()

Returns a string representation of the API currently in use.

Return Value

string

in ScopedClientInterface at line 28
string getSpaceId()

Returns the ID of the space currently in use.

Return Value

string

in ScopedClientInterface at line 35
string getEnvironmentId()

Returns the ID of the environment currently in use.

Return Value

string

at line 45
Asset getAsset(string $assetId, string $locale = \null)

Returns a single Asset object corresponding to the given ID.

Parameters

string $assetId
string $locale

Return Value

Asset

Exceptions

NotFoundException If no asset is found with the given ID

at line 54
ResourceArray|Asset[] getAssets(Query $query = \null)

Returns a collection of Asset objects wrapped in a ResourceArray instance.

Parameters

Query $query

Return Value

ResourceArray|Asset[]

at line 65
ContentType getContentType(string $contentTypeId)

Returns a single ContentType object corresponding to the given ID.

Parameters

string $contentTypeId

Return Value

ContentType

Exceptions

NotFoundException If no content type is found with the given ID

at line 74
ResourceArray|ContentType[] getContentTypes(Query $query = \null)

Returns a collection of ContentType objects wrapped in a ResourceArray instance.

Parameters

Query $query

Return Value

ResourceArray|ContentType[]

at line 81
Environment getEnvironment()

Returns the Environment object corresponding to the one in use.

Return Value

Environment

at line 93
Entry getEntry(string $entryId, string $locale = \null)

Returns a single Entry object corresponding to the given ID.

Parameters

string $entryId
string $locale

Return Value

Entry

Exceptions

NotFoundException If no entry is found with the given ID

at line 102
ResourceArray|Entry[] getEntries(Query $query = \null)

Returns a collection of Entry objects wrapped in a ResourceArray instance.

Parameters

Query $query

Return Value

ResourceArray|Entry[]

at line 109
Space getSpace()

Returns the Space object corresponding to the one in use.

Return Value

Space

Resolve a link to its actual resource.

Parameters

Link $link
string $locale

Return Value

ResourceInterface

Exceptions

InvalidArgumentException when encountering an unexpected link type

at line 133
ResourceInterface[] resolveLinkCollection(array $links, string $locale = \null)

Resolves an array of links.

A method implementing this may apply some optimizations to reduce the amount of necessary API calls.

Parameters

array $links
string $locale

Return Value

ResourceInterface[]