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

getApi()

Returns a string representation of the API currently in use.

getSpaceId()

Returns the ID of the space currently in use.

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.

getTag(string $tagId)

Find a specific tag by its id.

Tag[]
getAllTags()

Returns all tags in the current space and environment.

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

Returns a string representation of the API currently in use.

in ScopedClientInterface at line 24
getSpaceId()

Returns the ID of the space currently in use.

in ScopedClientInterface at line 29
getEnvironmentId()

Returns the ID of the environment currently in use.

at line 41
getAsset(string $assetId, string $locale = null)

Returns a single Asset object corresponding to the given ID.

Parameters

string $assetId
string $locale

Exceptions

NotFoundException If no asset is found with the given ID

at line 48
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 55
getContentType(string $contentTypeId)

Returns a single ContentType object corresponding to the given ID.

Parameters

string $contentTypeId

Exceptions

NotFoundException If no content type is found with the given ID

at line 62
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 67
getEnvironment()

Returns the Environment object corresponding to the one in use.

at line 74
getEntry(string $entryId, string $locale = null)

Returns a single Entry object corresponding to the given ID.

Parameters

string $entryId
string $locale

Exceptions

NotFoundException If no entry is found with the given ID

at line 81
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 86
getSpace()

Returns the Space object corresponding to the one in use.

at line 93
getTag(string $tagId)

Find a specific tag by its id.

Parameters

string $tagId the id of the tag

at line 100
Tag[] getAllTags()

Returns all tags in the current space and environment.

Return Value

Tag[]

Resolve a link to its actual resource.

Parameters

Link $link
string $locale

Exceptions

InvalidArgumentException when encountering an unexpected link type

at line 120
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[]