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.
Details
at line 52
__construct($token, string $spaceId, bool $preview = false, LoggerInterface $logger = null)
Client constructor.
in Client at line 69
protected array|object
request(string $method, string $path, array $options = [])
at line 71
protected string
getUserAgentAppName()
The name of the library to be used in the User-Agent header.
in Client at line 141
protected string
getUserAgent()
Returns the value of the User-Agent header for any requests made to Contentful
in Client at line 159
protected object|array
decodeJson(string $json)
at line 83
Asset
getAsset(string $id)
at line 101
ResourceArray
getAssets(Query $query = null)
at line 119
ContentType
getContentType(string $id)
at line 135
ResourceArray
getContentTypes(Query $query = null)
at line 150
EntryInterface
getEntry(string $id)
at line 168
ResourceArray
getEntries(Query $query = null)
at line 184
Space
getSpace()
at line 204
Asset|EntryInterface
resolveLink(Link $link)
Resolve a link to it's resource.
at line 230
Asset|ContentType|DynamicEntry|Space|DeletedAsset|DeletedEntry|ResourceArray
reviveJson(string $json)
Revive JSON previously cached.
at line 247
mixed
syncRequest(array $queryData)
Internal method for \Contentful\Delivery\Synchronization\Manager
at line 262
bool
isPreview()
Returns true when using the Preview API
at line 277
Manager
getSynchronizationManager()
Get an instance of the synchronization manager.