class SpaceProxy

SpaceProxy class.

This class works as a lazy reference to a space resource. You can use it for most space-related needs, such as fetching roles, API keys and webhooks, or creating them (attaching them to this space).

To access this class, you can use the convenience method found in a client object.

$space = $client->getSpaceProxy($spaceId);

The methods provided are very similar to the getX() methods you will find in an actual space resource object. The main difference is that when fetching a space resource, you will actually call the API, whereas with this proxy, you're just holding a reference to a certain space. This is the reason why in most situations you should prefer using a SpaceProxy rather than a space resource.

// Only the entries query will be made
$space = $client->getSpaceProxy($spaceId);
$entries = $space->getEntries();

// Two queries will be made
$space = $client->getSpace($spaceId);
$entries = $space->getEntries();

Traits

SpaceProxyExtension trait.

Properties

Client $client from SpaceProxyExtension

Methods

getSpaceId()

{@inheritdoc}

getAsset(string $environmentId, string $assetId)

Returns an Asset resource.

getAssets(string $environmentId, Query $query = null)

Returns a ResourceArray object which contains Asset resources.

getContentType(string $environmentId, string $contentTypeId)

Returns a ContentType resource.

getContentTypes(string $environmentId, Query $query = null)

Returns a ResourceArray object which contains ContentType resources.

getPublishedContentType(string $environmentId, string $contentTypeId)

Returns a published ContentType resource.

getPublishedContentTypes(string $environmentId, Query $query = null)

Returns a ResourceArray object which contains published ContentType resources.

getContentTypeSnapshot(string $environmentId, string $contentTypeId, string $snapshotId)

Returns a ContentTypeSnapshot resource.

getContentTypeSnapshots(string $environmentId, string $contentTypeId, Query $query = null)

Returns a ResourceArray object which contains ContentTypeSnapshot resources.

getDeliveryApiKey(string $deliveryApiKeyId)

Returns a DeliveryApiKey resource.

getDeliveryApiKeys(Query $query = null)

Returns a ResourceArray object containing DeliveryApiKey objects.

getEditorInterface(string $environmentId, string $contentTypeId)

Returns an EditorInterface resource.

getEntry(string $environmentId, string $entryId)

Returns an Entry resource.

getEntries(string $environmentId, Query $query = null)

Returns a ResourceArray object which contains Entry resources.

getEntrySnapshot(string $environmentId, string $entryId, string $snapshotId)

Returns a EntrySnapshot resource.

getEntrySnapshots(string $environmentId, string $entryId, Query $query = null)

Returns a ResourceArray object which contains EntrySnapshot resources.

getEnvironment(string $environmentId)

Returns an Environment resource.

getEnvironments(Query $query = null)

Returns a ResourceArray object which contains Environment resources.

getExtension(string $environmentId, string $extensionId)

Returns an Extension resource.

getExtensions(string $environmentId)

Returns a ResourceArray object containing Extension resources.

getLocale(string $environmentId, string $localeId)

Returns a Locale resource.

getLocales(string $environmentId)

Returns a ResourceArray object containing Locale resources.

getPreviewApiKey(string $previewApiKeyId)

Returns a PreviewApiKey resource.

getPreviewApiKeys(Query $query = null)

Returns a ResourceArray object containing PreviewApiKey resources.

getRole(string $roleId)

Returns a Role resource.

getRoles(Query $query = null)

Returns a ResourceArray object containing Role resources.

getSpaceMembership(string $spaceMembershipId)

Returns a SpaceMembership resource.

getSpaceMemberships(Query $query = null)

Returns a ResourceArray object containing SpaceMembership resources.

getUpload(string $uploadId)

Returns an Upload resource.

getWebhook(string $webhookId)

Returns a Webhook resource.

getWebhooks(Query $query = null)

Returns a ResourceArray object containing Webhook resources.

getWebhookCall(string $webhookId, string $callId)

Returns a WebhookCall resource.

getWebhookCalls(string $webhookId, Query $query = null)

Returns a ResourceArray object containing WebhookCall resources.

getWebhookHealth(string $webhookId)

Returns an WebhookHealth resource.

__construct(Client $client, string $spaceId)

No description

getEnvironmentProxy(string $environmentId)

Returns a proxy to an environment resource.

create(CreatableInterface $resource, string $resourceId = '', $parameters = [])

Persist a new resource in Contentful.

resolveLink(Link $link, array $parameters = [])

Resolves a Contentful link scoped to the current space.

toResource()

Returns the Space resource which corresponds to this proxy.

Details

at line 72
protected getSpaceId()

{@inheritdoc}

in SpaceProxyExtension at line 58
getAsset(string $environmentId, string $assetId)

Returns an Asset resource.

Parameters

string $environmentId
string $assetId

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/assets/asset

in SpaceProxyExtension at line 72
getAssets(string $environmentId, Query $query = null)

Returns a ResourceArray object which contains Asset resources.

Parameters

string $environmentId
Query $query

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/assets/assets-collection

in SpaceProxyExtension at line 86
getContentType(string $environmentId, string $contentTypeId)

Returns a ContentType resource.

Parameters

string $environmentId
string $contentTypeId

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/content-types/content-type

in SpaceProxyExtension at line 100
getContentTypes(string $environmentId, Query $query = null)

Returns a ResourceArray object which contains ContentType resources.

Parameters

string $environmentId
Query $query

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/content-types/content-type-collection

in SpaceProxyExtension at line 114
getPublishedContentType(string $environmentId, string $contentTypeId)

Returns a published ContentType resource.

Parameters

string $environmentId
string $contentTypeId

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/content-types/activated-content-type-collection

in SpaceProxyExtension at line 128
getPublishedContentTypes(string $environmentId, Query $query = null)

Returns a ResourceArray object which contains published ContentType resources.

Parameters

string $environmentId
Query $query

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/content-types/activated-content-type-collection

in SpaceProxyExtension at line 142
getContentTypeSnapshot(string $environmentId, string $contentTypeId, string $snapshotId)

Returns a ContentTypeSnapshot resource.

Parameters

string $environmentId
string $contentTypeId
string $snapshotId

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/snapshots/content-type-snapshot

in SpaceProxyExtension at line 157
getContentTypeSnapshots(string $environmentId, string $contentTypeId, Query $query = null)

Returns a ResourceArray object which contains ContentTypeSnapshot resources.

Parameters

string $environmentId
string $contentTypeId
Query $query

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/snapshots/content-type-snapshots-collection

in SpaceProxyExtension at line 172
getDeliveryApiKey(string $deliveryApiKeyId)

Returns a DeliveryApiKey resource.

Parameters

string $deliveryApiKeyId

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/api-keys

in SpaceProxyExtension at line 185
getDeliveryApiKeys(Query $query = null)

Returns a ResourceArray object containing DeliveryApiKey objects.

Parameters

Query $query

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/api-keys/api-keys-collection

in SpaceProxyExtension at line 198
getEditorInterface(string $environmentId, string $contentTypeId)

Returns an EditorInterface resource.

Parameters

string $environmentId
string $contentTypeId

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/editor-interface

in SpaceProxyExtension at line 212
getEntry(string $environmentId, string $entryId)

Returns an Entry resource.

Parameters

string $environmentId
string $entryId

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/entries/entry

in SpaceProxyExtension at line 226
getEntries(string $environmentId, Query $query = null)

Returns a ResourceArray object which contains Entry resources.

Parameters

string $environmentId
Query $query

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/entries/entries-collection

in SpaceProxyExtension at line 240
getEntrySnapshot(string $environmentId, string $entryId, string $snapshotId)

Returns a EntrySnapshot resource.

Parameters

string $environmentId
string $entryId
string $snapshotId

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/snapshots/entry-snapshot

in SpaceProxyExtension at line 255
getEntrySnapshots(string $environmentId, string $entryId, Query $query = null)

Returns a ResourceArray object which contains EntrySnapshot resources.

Parameters

string $environmentId
string $entryId
Query $query

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/snapshots/entry-snapshots-collection

in SpaceProxyExtension at line 270
getEnvironment(string $environmentId)

Returns an Environment resource.

Parameters

string $environmentId

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/environments/environment

in SpaceProxyExtension at line 283
getEnvironments(Query $query = null)

Returns a ResourceArray object which contains Environment resources.

Parameters

Query $query

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/environments/environments-collection

in SpaceProxyExtension at line 296
getExtension(string $environmentId, string $extensionId)

Returns an Extension resource.

Parameters

string $environmentId
string $extensionId

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/ui-extensions/extension

in SpaceProxyExtension at line 310
getExtensions(string $environmentId)

Returns a ResourceArray object containing Extension resources.

Parameters

string $environmentId

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/ui-extensions/extensions-collection

in SpaceProxyExtension at line 323
getLocale(string $environmentId, string $localeId)

Returns a Locale resource.

Parameters

string $environmentId
string $localeId

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/locales/locale

in SpaceProxyExtension at line 337
getLocales(string $environmentId)

Returns a ResourceArray object containing Locale resources.

Parameters

string $environmentId

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/locales/locale-collection

in SpaceProxyExtension at line 350
getPreviewApiKey(string $previewApiKeyId)

Returns a PreviewApiKey resource.

Parameters

string $previewApiKeyId

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/api-keys

in SpaceProxyExtension at line 363
getPreviewApiKeys(Query $query = null)

Returns a ResourceArray object containing PreviewApiKey resources.

Parameters

Query $query

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/api-keys/api-keys-collection

in SpaceProxyExtension at line 376
getRole(string $roleId)

Returns a Role resource.

Parameters

string $roleId

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/roles/role

in SpaceProxyExtension at line 389
getRoles(Query $query = null)

Returns a ResourceArray object containing Role resources.

Parameters

Query $query

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/roles/roles-collection

in SpaceProxyExtension at line 402
getSpaceMembership(string $spaceMembershipId)

Returns a SpaceMembership resource.

Parameters

string $spaceMembershipId

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/space-memberships/space-membership

in SpaceProxyExtension at line 415
getSpaceMemberships(Query $query = null)

Returns a ResourceArray object containing SpaceMembership resources.

Parameters

Query $query

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/space-memberships

in SpaceProxyExtension at line 428
getUpload(string $uploadId)

Returns an Upload resource.

Parameters

string $uploadId

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/uploads/retrieving-an-upload

in SpaceProxyExtension at line 441
getWebhook(string $webhookId)

Returns a Webhook resource.

Parameters

string $webhookId

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/webhooks/webhook

in SpaceProxyExtension at line 454
getWebhooks(Query $query = null)

Returns a ResourceArray object containing Webhook resources.

Parameters

Query $query

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/webhooks/webhooks-collection

in SpaceProxyExtension at line 467
getWebhookCall(string $webhookId, string $callId)

Returns a WebhookCall resource.

Parameters

string $webhookId
string $callId

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/webhook-calls/webhook-call-details

in SpaceProxyExtension at line 481
getWebhookCalls(string $webhookId, Query $query = null)

Returns a ResourceArray object containing WebhookCall resources.

Parameters

string $webhookId
Query $query

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/webhook-calls/webhook-call-overview

in SpaceProxyExtension at line 495
getWebhookHealth(string $webhookId)

Returns an WebhookHealth resource.

Parameters

string $webhookId

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/webhook-calls/webhook-health

at line 63
__construct(Client $client, string $spaceId)

Parameters

Client $client
string $spaceId

at line 81
getEnvironmentProxy(string $environmentId)

Returns a proxy to an environment resource.

Useful for all environment-scoped operations.

Parameters

string $environmentId

at line 96
create(CreatableInterface $resource, string $resourceId = '', $parameters = [])

Persist a new resource in Contentful.

This is a convenience method which just forwards to Client::create(), but setting the space key to the current space ID in the parameters array.

Parameters

CreatableInterface $resource
string $resourceId
$parameters

See also

\Contentful\Management\Client::create()

Resolves a Contentful link scoped to the current space.

Parameters

Link $link
array $parameters

at line 122
toResource()

Returns the Space resource which corresponds to this proxy.

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/spaces/space