class Environment extends BaseResource implements CreatableInterface

Environment class.

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

Traits

EnvironmentProxyExtension trait.
DeletableTrait.
UpdatableTrait.

Properties

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

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.

getSpaceId()

{@inheritdoc}

getEnvironmentId()

{@inheritdoc}

getAsset(string $assetId)

Returns an Asset resource.

ResourceArray
getAssets(Query $query = \null)

Returns a ResourceArray object which contains Asset resources.

getContentType(string $contentTypeId)

Returns a ContentType resource.

ResourceArray
getContentTypes(Query $query = \null)

Returns a ResourceArray object which contains ContentType resources.

getPublishedContentType(string $contentTypeId)

Returns a published ContentType resource.

ResourceArray
getPublishedContentTypes(Query $query = \null)

Returns a ResourceArray object which contains published ContentType resources.

getContentTypeSnapshot(string $contentTypeId, string $snapshotId)

Returns a ContentTypeSnapshot resource.

ResourceArray
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.

ResourceArray
getEntries(Query $query = \null)

Returns a ResourceArray object which contains Entry resources.

getEntrySnapshot(string $entryId, string $snapshotId)

Returns a EntrySnapshot resource.

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

Returns a ResourceArray object which contains EntrySnapshot resources.

getExtension(string $extensionId)

Returns an Extension resource.

ResourceArray
getExtensions()

Returns a ResourceArray object containing Extension resources.

getLocale(string $localeId)

Returns a Locale resource.

ResourceArray
getLocales()

Returns a ResourceArray object containing Locale resources.

delete()

Deletes the current resource.

update()

Updates the current resource.

getSystemProperties()

{@inheritdoc}

__construct(string $name)

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.

string
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 76
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 79
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

at line 107
protected getSpaceId()

{@inheritdoc}

at line 115
protected getEnvironmentId()

{@inheritdoc}

Asset getAsset(string $assetId)

Returns an Asset resource.

Parameters

string $assetId

Return Value

Asset

See also

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

ResourceArray getAssets(Query $query = \null)

Returns a ResourceArray object which contains Asset resources.

Parameters

Query $query

Return Value

ResourceArray

See also

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

ContentType getContentType(string $contentTypeId)

Returns a ContentType resource.

Parameters

string $contentTypeId

Return Value

ContentType

See also

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

ResourceArray getContentTypes(Query $query = \null)

Returns a ResourceArray object which contains ContentType resources.

Parameters

Query $query

Return Value

ResourceArray

See also

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

ContentType getPublishedContentType(string $contentTypeId)

Returns a published ContentType resource.

Parameters

string $contentTypeId

Return Value

ContentType

See also

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

ResourceArray getPublishedContentTypes(Query $query = \null)

Returns a ResourceArray object which contains published ContentType resources.

Parameters

Query $query

Return Value

ResourceArray

See also

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

ContentTypeSnapshot getContentTypeSnapshot(string $contentTypeId, string $snapshotId)

Returns a ContentTypeSnapshot resource.

Parameters

string $contentTypeId
string $snapshotId

Return Value

ContentTypeSnapshot

See also

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

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

Returns a ResourceArray object which contains ContentTypeSnapshot resources.

Parameters

string $contentTypeId
Query $query

Return Value

ResourceArray

See also

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

EditorInterface getEditorInterface(string $contentTypeId)

Returns an EditorInterface resource.

Parameters

string $contentTypeId

Return Value

EditorInterface

See also

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

Entry getEntry(string $entryId)

Returns an Entry resource.

Parameters

string $entryId

Return Value

Entry

See also

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

ResourceArray getEntries(Query $query = \null)

Returns a ResourceArray object which contains Entry resources.

Parameters

Query $query

Return Value

ResourceArray

See also

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

EntrySnapshot getEntrySnapshot(string $entryId, string $snapshotId)

Returns a EntrySnapshot resource.

Parameters

string $entryId
string $snapshotId

Return Value

EntrySnapshot

See also

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

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

Returns a ResourceArray object which contains EntrySnapshot resources.

Parameters

string $entryId
Query $query

Return Value

ResourceArray

See also

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

Extension getExtension(string $extensionId)

Returns an Extension resource.

Parameters

string $extensionId

Return Value

Extension

See also

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

ResourceArray getExtensions()

Returns a ResourceArray object containing Extension resources.

Return Value

ResourceArray

See also

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

Locale getLocale(string $localeId)

Returns a Locale resource.

Parameters

string $localeId

Return Value

Locale

See also

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

ResourceArray getLocales()

Returns a ResourceArray object containing Locale resources.

Return Value

ResourceArray

See also

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

in DeletableTrait at line 28
delete()

Deletes the current resource.

in UpdatableTrait at line 40
update()

Updates the current resource.

at line 57
getSystemProperties()

{@inheritdoc}

at line 49
__construct(string $name)

Environment constructor.

Parameters

string $name

at line 65
jsonSerialize()

{@inheritdoc}

at line 88
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 99
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 123
string getName()

Return Value

string

at line 133
Environment setName(string $name)

Parameters

string $name

Return Value

Environment