SpaceProxy
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
Properties
Client | $client | from SpaceProxyExtension |
Methods
{@inheritdoc}
Returns an Asset resource.
Returns a ResourceArray object which contains Asset resources.
Returns a ContentType resource.
Returns a ResourceArray object which contains ContentType resources.
Returns a published ContentType resource.
Returns a ResourceArray object which contains published ContentType resources.
Returns a ContentTypeSnapshot resource.
Returns a ResourceArray object which contains ContentTypeSnapshot resources.
Returns a DeliveryApiKey resource.
Returns a ResourceArray object containing DeliveryApiKey objects.
Returns an EditorInterface resource.
Returns an Entry resource.
Returns a ResourceArray object which contains Entry resources.
Returns a EntrySnapshot resource.
Returns a ResourceArray object which contains EntrySnapshot resources.
Returns a ResourceArray object which contains Environment resources.
Returns an Extension resource.
Returns a ResourceArray object containing Extension resources.
Returns a Locale resource.
Returns a ResourceArray object containing Locale resources.
Returns a PreviewApiKey resource.
Returns a ResourceArray object containing PreviewApiKey resources.
Returns a SpaceMembership resource.
Returns a ResourceArray object containing SpaceMembership resources.
Returns a WebhookCall resource.
Returns a ResourceArray object containing WebhookCall resources.
Returns a proxy to an environment resource.
Persist a new resource in Contentful.
Resolves a Contentful link scoped to the current space.
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.
in SpaceProxyExtension at line 72
getAssets(string $environmentId, Query $query = null)
Returns a ResourceArray object which contains Asset resources.
in SpaceProxyExtension at line 86
getContentType(string $environmentId, string $contentTypeId)
Returns a ContentType resource.
in SpaceProxyExtension at line 100
getContentTypes(string $environmentId, Query $query = null)
Returns a ResourceArray object which contains ContentType resources.
in SpaceProxyExtension at line 114
getPublishedContentType(string $environmentId, string $contentTypeId)
Returns a published ContentType resource.
in SpaceProxyExtension at line 128
getPublishedContentTypes(string $environmentId, Query $query = null)
Returns a ResourceArray object which contains published ContentType resources.
in SpaceProxyExtension at line 142
getContentTypeSnapshot(string $environmentId, string $contentTypeId, string $snapshotId)
Returns a ContentTypeSnapshot resource.
in SpaceProxyExtension at line 157
getContentTypeSnapshots(string $environmentId, string $contentTypeId, Query $query = null)
Returns a ResourceArray object which contains ContentTypeSnapshot resources.
in SpaceProxyExtension at line 172
getDeliveryApiKey(string $deliveryApiKeyId)
Returns a DeliveryApiKey resource.
in SpaceProxyExtension at line 185
getDeliveryApiKeys(Query $query = null)
Returns a ResourceArray object containing DeliveryApiKey objects.
in SpaceProxyExtension at line 198
getEditorInterface(string $environmentId, string $contentTypeId)
Returns an EditorInterface resource.
in SpaceProxyExtension at line 212
getEntry(string $environmentId, string $entryId)
Returns an Entry resource.
in SpaceProxyExtension at line 226
getEntries(string $environmentId, Query $query = null)
Returns a ResourceArray object which contains Entry resources.
in SpaceProxyExtension at line 240
getEntrySnapshot(string $environmentId, string $entryId, string $snapshotId)
Returns a EntrySnapshot resource.
in SpaceProxyExtension at line 255
getEntrySnapshots(string $environmentId, string $entryId, Query $query = null)
Returns a ResourceArray object which contains EntrySnapshot resources.
in SpaceProxyExtension at line 270
getEnvironment(string $environmentId)
Returns an Environment resource.
in SpaceProxyExtension at line 283
getEnvironments(Query $query = null)
Returns a ResourceArray object which contains Environment resources.
in SpaceProxyExtension at line 296
getExtension(string $environmentId, string $extensionId)
Returns an Extension resource.
in SpaceProxyExtension at line 310
getExtensions(string $environmentId)
Returns a ResourceArray object containing Extension resources.
in SpaceProxyExtension at line 323
getLocale(string $environmentId, string $localeId)
Returns a Locale resource.
in SpaceProxyExtension at line 337
getLocales(string $environmentId)
Returns a ResourceArray object containing Locale resources.
in SpaceProxyExtension at line 350
getPreviewApiKey(string $previewApiKeyId)
Returns a PreviewApiKey resource.
in SpaceProxyExtension at line 363
getPreviewApiKeys(Query $query = null)
Returns a ResourceArray object containing PreviewApiKey resources.
in SpaceProxyExtension at line 376
getRole(string $roleId)
Returns a Role resource.
in SpaceProxyExtension at line 389
getRoles(Query $query = null)
Returns a ResourceArray object containing Role resources.
in SpaceProxyExtension at line 402
getSpaceMembership(string $spaceMembershipId)
Returns a SpaceMembership resource.
in SpaceProxyExtension at line 415
getSpaceMemberships(Query $query = null)
Returns a ResourceArray object containing SpaceMembership resources.
in SpaceProxyExtension at line 428
getUpload(string $uploadId)
Returns an Upload resource.
in SpaceProxyExtension at line 441
getWebhook(string $webhookId)
Returns a Webhook resource.
in SpaceProxyExtension at line 454
getWebhooks(Query $query = null)
Returns a ResourceArray object containing Webhook resources.
in SpaceProxyExtension at line 467
getWebhookCall(string $webhookId, string $callId)
Returns a WebhookCall resource.
in SpaceProxyExtension at line 481
getWebhookCalls(string $webhookId, Query $query = null)
Returns a ResourceArray object containing WebhookCall resources.
in SpaceProxyExtension at line 495
getWebhookHealth(string $webhookId)
Returns an WebhookHealth resource.
at line 63
__construct(Client $client, string $spaceId)
at line 81
getEnvironmentProxy(string $environmentId)
Returns a proxy to an environment resource.
Useful for all environment-scoped operations.
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.
at line 110
resolveLink(Link $link, array $parameters = [])
Resolves a Contentful link scoped to the current space.
at line 122
toResource()
Returns the Space resource which corresponds to this proxy.