class Environment extends BaseResource implements CreatableInterface

Environment class.

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

Traits

EnvironmentProxyExtension trait.
DeletableTrait.
UpdatableTrait.

Properties

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

Methods

initialize(string $type, array $sys = [])

Initialize system properties.

getSystemProperties()

{@inheritdoc}

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()

Deletes the current resource.

__construct(string $name)

Environment constructor.

array
jsonSerialize()

Returns an array to be used by "json_encode" to serialize objects of this class.

string[]
asUriParameters()

Returns an associate 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 39
protected initialize(string $type, array $sys = [])

Initialize system properties.

Parameters

string $type The system type
array $sys

in BaseResource at line 48
getSystemProperties()

{@inheritdoc}

in BaseResource at line 56
getId()

{@inheritdoc}

in BaseResource at line 64
getType()

{@inheritdoc}

{@inheritdoc}

at line 64
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 98
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 95
protected getSpaceId()

{@inheritdoc}

at line 103
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 29
delete()

Deletes the current resource.

in UpdatableTrait at line 38
update()

Deletes the current resource.

at line 42
__construct(string $name)

Environment constructor.

Parameters

string $name

at line 53
array jsonSerialize()

Returns an array to be used by "json_encode" to serialize objects of this class.

Return Value

array

at line 76
string[] asUriParameters()

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

Return Value

string[]

at line 87
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 111
string getName()

Return Value

string

at line 121
Environment setName(string $name)

Parameters

string $name

Return Value

Environment