Client
class Client extends Client
Client class.
This class is responsible for querying Contentful's Content Management API.
Constants
VERSION |
The current version of the SDK. |
URI_MANAGEMENT |
The default URI to which all requests should be made. |
URI_UPLOAD |
The special URI for uploading files. |
Properties
Asset | $asset | ||
ContentType | $contentType | ||
ContentTypeSnapshot | $contentTypeSnapshot | ||
DeliveryApiKey | $deliveryApiKey | ||
EditorInterface | $editorInterface | ||
Entry | $entry | ||
EntrySnapshot | $entrySnapshot | ||
Extension | $extension | ||
Locale | $locale | ||
Organization | $organization | ||
PersonalAccessToken | $personalAccessToken | ||
PreviewApiKey | $previewApiKey | ||
PublishedContentType | $publishedContentType | ||
Role | $role | ||
Space | $space | ||
SpaceMembership | $spaceMembership | ||
Upload | $upload | ||
User | $user | ||
Webhook | $webhook | ||
WebhookCall | $webhookCall | ||
WebhookHealth | $webhookHealth |
Methods
Client constructor.
Returns the active ResourceBuilder instance.
Returns the space ID to which this client is currently bound.
Sets the space ID to which the client is currently bound.
Returns a proxy instance responsible for querying certain endpoints.
Makes a GET call to an API endpoint, and returns the built object.
Requests an API resource and applies the result to the given object.
Resolves a Link object to the actual resource.
{@inheritdoc}
{@inheritdoc}
{@inheritdoc}
{@inheritdoc}
Details
at line 123
__construct(string $token, string $currentSpaceId = null, array $options = [])
Client constructor.
at line 141
ResourceBuilder
getBuilder()
Returns the active ResourceBuilder instance.
at line 153
Client
setBuilder(ResourceBuilder $builder)
Sets the active ResourceBuilder instance.
at line 166
string|null
getCurrentSpaceId()
Returns the space ID to which this client is currently bound.
It can be null, as certain operations are not done on a space level.
at line 178
Client
setCurrentSpaceId(string $currentSpaceId = null)
Sets the space ID to which the client is currently bound.
at line 195
BaseProxy
getProxy(string $name, string $spaceId = null)
Returns a proxy instance responsible for querying certain endpoints.
at line 229
BaseProxy
__get(string $name)
Convenience method for accessing a proxy.
Allows for this usage.
$entry = $client->entries->get($entryId);
Attention: if no space ID is provided and the proxy requires one, it will throw an exception.
at line 245
ResourceArray|ResourceInterface
getResource(string $uri, Query $query = null, array $options = [], ResourceInterface $resource = null)
Makes a GET call to an API endpoint, and returns the built object.
at line 264
requestResource(string $method, string $uri, array $options = [], ResourceInterface $resource = null)
Requests an API resource and applies the result to the given object.
at line 285
ResourceInterface
resolveLink(Link $link, string $spaceId = null)
Resolves a Link object to the actual resource.
at line 313
protected
getSdkName()
{@inheritdoc}
at line 321
protected
getSdkVersion()
{@inheritdoc}
at line 329
protected
getApiContentType()
{@inheritdoc}
at line 337
protected
getExceptionMap()
{@inheritdoc}