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.
Set the application name and version. The values are used as part of the X-Contentful-User-Agent header.
Set the integration name and version. The values are used as part of the X-Contentful-User-Agent header.
The name of the library to be used in the User-Agent header.
The version of the library to be used in the User-Agent header.
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 72
__construct(string $token, string $spaceId, bool $preview = false, string|null $defaultLocale = null, array $options = [])
Client constructor.
in Client at line 80
$this
setApplication(string|null $name, string|null $version = null)
Set the application name and version. The values are used as part of the X-Contentful-User-Agent header.
in Client at line 95
$this
setIntegration(string|null $name, string|null $version = null)
Set the integration name and version. The values are used as part of the X-Contentful-User-Agent header.
in Client at line 109
protected array|null
request(string $method, string $path, array $options = [])
at line 108
protected string
getSdkName()
The name of the library to be used in the User-Agent header.
at line 118
protected string
getSdkVersion()
The version of the library to be used in the User-Agent header.
at line 131
Asset
getAsset(string $id, string|null $locale = null)
at line 147
ResourceArray
getAssets(Query $query = null)
at line 167
ContentType
getContentType(string $id)
at line 188
ResourceArray
getContentTypes(Query $query = null)
at line 205
EntryInterface
getEntry(string $id, string|null $locale = null)
at line 221
ResourceArray
getEntries(Query $query = null)
at line 239
Space
getSpace()
at line 265
Asset|EntryInterface
resolveLink(Link $link, string|null $locale = null)
Resolve a link to it's resource.
at line 291
Asset|ContentType|DynamicEntry|Space|DeletedAsset|DeletedEntry|ResourceArray
reviveJson(string $json)
Revive JSON previously cached.
at line 308
mixed
syncRequest(array $queryData)
Internal method for \Contentful\Delivery\Synchronization\Manager
at line 323
bool
isPreview()
Returns true when using the Preview API
at line 337
Manager
getSynchronizationManager()
Get an instance of the synchronization manager. Note that with the Preview API only an inital sync is giving valid results.