Client
class Client extends Client
A Client is used to communicate the Contentful Delivery API.
A Client is only responsible for one Space. When access to multiple spaces is required, create multiple Clients.
This class can be configured to use the Preview API instead of the Delivery API. This grants access to not yet published content.
Constants
VERSION |
|
Methods
Client constructor.
The name of the library to be used in the User-Agent header.
Returns the value of the User-Agent header for any requests made to Contentful
No description
No description
Revive JSON previously cached.
Internal method for \Contentful\Delivery\Synchronization\Manager
Returns true when using the Preview API
Get an instance of the synchronization manager. Note that with the Preview API only an inital sync is giving valid results.
Details
at line 71
__construct(string $token, string $spaceId, bool $preview = false, string|null $defaultLocale = null, array $options = [])
Client constructor.
in Client at line 78
protected array
request(string $method, string $path, array $options = [])
at line 107
protected string
getUserAgentAppName()
The name of the library to be used in the User-Agent header.
in Client at line 194
protected string
getUserAgent()
Returns the value of the User-Agent header for any requests made to Contentful
in Client at line 214
static array
decodeJson(string $json)
at line 120
Asset
getAsset(string $id, string|null $locale = null)
at line 135
ResourceArray
getAssets(Query $query = null)
at line 155
ContentType
getContentType(string $id)
at line 176
ResourceArray
getContentTypes(Query $query = null)
at line 192
EntryInterface
getEntry(string $id, string|null $locale = null)
at line 207
ResourceArray
getEntries(Query $query = null)
at line 225
Space
getSpace()
at line 251
Asset|EntryInterface
resolveLink(Link $link, string|null $locale = null)
Resolve a link to it's resource.
at line 277
Asset|ContentType|DynamicEntry|Space|DeletedAsset|DeletedEntry|ResourceArray
reviveJson(string $json)
Revive JSON previously cached.
at line 294
mixed
syncRequest(array $queryData)
Internal method for \Contentful\Delivery\Synchronization\Manager
at line 309
bool
isPreview()
Returns true when using the Preview API
at line 323
Manager
getSynchronizationManager()
Get an instance of the synchronization manager. Note that with the Preview API only an inital sync is giving valid results.