class Environment extends BaseResource implements CreatableInterface

Environment class.

This class represents a resource with type "Environment" in Contentful.

Traits

DeletableTrait.
EnvironmentProxyExtension trait.
UpdatableTrait.

Properties

protected Environment $sys
Client $client from UpdatableTrait
protected string $name
protected string $sourceEnv

Methods

getId()

{@inheritdoc}

getType()

{@inheritdoc}

asLink()

{@inheritdoc}

mixed
asRequestBody()

Returns the resource in the form of request body.

setClient(Client $client)

Sets the current Client object instance.

delete()

Deletes the current resource.

getSpaceId()

{@inheritdoc}

getEnvironmentId()

{@inheritdoc}

getAsset(string $assetId)

Returns an Asset resource.

getAssets(Query $query = null)

Returns a ResourceArray object which contains Asset resources.

getContentType(string $contentTypeId)

Returns a ContentType resource.

getContentTypes(Query $query = null)

Returns a ResourceArray object which contains ContentType resources.

getPublishedContentType(string $contentTypeId)

Returns a published ContentType resource.

getPublishedContentTypes(Query $query = null)

Returns a ResourceArray object which contains published ContentType resources.

getContentTypeSnapshot(string $contentTypeId, string $snapshotId)

Returns a ContentTypeSnapshot resource.

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

Returns a ResourceArray object which contains ContentTypeSnapshot resources.

getEditorInterface(string $contentTypeId)

Returns an EditorInterface resource.

getEntry(string $entryId)

Returns an Entry resource.

getEntries(Query $query = null)

Returns a ResourceArray object which contains Entry resources.

getEntrySnapshot(string $entryId, string $snapshotId)

Returns a EntrySnapshot resource.

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

Returns a ResourceArray object which contains EntrySnapshot resources.

getExtension(string $extensionId)

Returns an Extension resource.

getExtensions()

Returns a ResourceArray object containing Extension resources.

getLocale(string $localeId)

Returns a Locale resource.

getLocales()

Returns a ResourceArray object containing Locale resources.

update()

Updates the current resource.

getSystemProperties()

{@inheritdoc}

__construct(string $name, $source_environment_id = '')

Environment constructor.

jsonSerialize()

{@inheritdoc}

string[]
asUriParameters()

Returns an associative array where keys are the name of the fragments in a URI, and the values are the corresponding IDs.

string[]
getHeadersForCreation()

Returns an array of headers that the current resource needs to sent for being created.

getName()

No description

setName(string $name)

No description

Details

in BaseResource at line 37
getId()

{@inheritdoc}

in BaseResource at line 45
getType()

{@inheritdoc}

{@inheritdoc}

at line 82
mixed asRequestBody()

Returns the resource in the form of request body.

This can differ from regular serialization, as some fields may not be present in the request payload.

Return Value

mixed

in BaseResource at line 77
BaseResource setClient(Client $client)

Sets the current Client object instance.

This is done automatically when performing API calls, so it shouldn't be used manually.

Parameters

Client $client

Return Value

BaseResource

in DeletableTrait at line 28
delete()

Deletes the current resource.

at line 117
protected getSpaceId()

{@inheritdoc}

at line 125
protected getEnvironmentId()

{@inheritdoc}

getAsset(string $assetId)

Returns an Asset resource.

Parameters

string $assetId

See also

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

getAssets(Query $query = null)

Returns a ResourceArray object which contains Asset resources.

Parameters

Query $query

See also

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

getContentType(string $contentTypeId)

Returns a ContentType resource.

Parameters

string $contentTypeId

See also

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

getContentTypes(Query $query = null)

Returns a ResourceArray object which contains ContentType resources.

Parameters

Query $query

See also

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

getPublishedContentType(string $contentTypeId)

Returns a published ContentType resource.

Parameters

string $contentTypeId

See also

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

getPublishedContentTypes(Query $query = null)

Returns a ResourceArray object which contains published ContentType resources.

Parameters

Query $query

See also

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

getContentTypeSnapshot(string $contentTypeId, string $snapshotId)

Returns a ContentTypeSnapshot resource.

Parameters

string $contentTypeId
string $snapshotId

See also

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

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

Returns a ResourceArray object which contains ContentTypeSnapshot resources.

Parameters

string $contentTypeId
Query $query

See also

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

getEditorInterface(string $contentTypeId)

Returns an EditorInterface resource.

Parameters

string $contentTypeId

See also

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

getEntry(string $entryId)

Returns an Entry resource.

Parameters

string $entryId

See also

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

getEntries(Query $query = null)

Returns a ResourceArray object which contains Entry resources.

Parameters

Query $query

See also

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

getEntrySnapshot(string $entryId, string $snapshotId)

Returns a EntrySnapshot resource.

Parameters

string $entryId
string $snapshotId

See also

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

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

Returns a ResourceArray object which contains EntrySnapshot resources.

Parameters

string $entryId
Query $query

See also

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

getExtension(string $extensionId)

Returns an Extension resource.

Parameters

string $extensionId

See also

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

getExtensions()

Returns a ResourceArray object containing Extension resources.

See also

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

getLocale(string $localeId)

Returns a Locale resource.

Parameters

string $localeId

See also

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

getLocales()

Returns a ResourceArray object containing Locale resources.

See also

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

in UpdatableTrait at line 40
update()

Updates the current resource.

at line 63
getSystemProperties()

{@inheritdoc}

at line 54
__construct(string $name, $source_environment_id = '')

Environment constructor.

Parameters

string $name
$source_environment_id

at line 71
jsonSerialize()

{@inheritdoc}

at line 94
string[] asUriParameters()

Returns an associative array where keys are the name of the fragments in a URI, and the values are the corresponding IDs.

Return Value

string[]

at line 105
string[] getHeadersForCreation()

Returns an array of headers that the current resource needs to sent for being created.

This method is supposed to be overridden if necessary.

Return Value

string[]

at line 130
getName()

at line 138
Environment setName(string $name)

Parameters

string $name

Return Value

Environment