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

string
getId()

{@inheritdoc}

string
getType()

{@inheritdoc}

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

__construct(string $name)

Environment constructor.

array
jsonSerialize()

{@inheritdoc}

array
asUriParameters()

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

array
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
string getId()

{@inheritdoc}

Return Value

string

in BaseResource at line 45
string getType()

{@inheritdoc}

Return Value

string

{@inheritdoc}

Return Value

Link

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.

ResourceArray getAssets(Query $query = \null)

Returns a ResourceArray object which contains Asset resources.

ContentType getContentType(string $contentTypeId)

Returns a ContentType resource.

ResourceArray getContentTypes(Query $query = \null)

Returns a ResourceArray object which contains ContentType resources.

ContentType getPublishedContentType(string $contentTypeId)

Returns a published ContentType resource.

ResourceArray getPublishedContentTypes(Query $query = \null)

Returns a ResourceArray object which contains published ContentType resources.

ContentTypeSnapshot getContentTypeSnapshot(string $contentTypeId, string $snapshotId)

Returns a ContentTypeSnapshot resource.

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

Returns a ResourceArray object which contains ContentTypeSnapshot resources.

EditorInterface getEditorInterface(string $contentTypeId)

Returns an EditorInterface resource.

Entry getEntry(string $entryId)

Returns an Entry resource.

ResourceArray getEntries(Query $query = \null)

Returns a ResourceArray object which contains Entry resources.

EntrySnapshot getEntrySnapshot(string $entryId, string $snapshotId)

Returns a EntrySnapshot resource.

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

Returns a ResourceArray object which contains EntrySnapshot resources.

Extension getExtension(string $extensionId)

Returns an Extension resource.

ResourceArray getExtensions()

Returns a ResourceArray object containing Extension resources.

Locale getLocale(string $localeId)

Returns a Locale resource.

ResourceArray getLocales()

Returns a ResourceArray object containing Locale resources.

in DeletableTrait at line 28
delete()

Deletes the current resource.

in UpdatableTrait at line 40
update()

Updates the current resource.

at line 57
Environment getSystemProperties()

{@inheritdoc}

Return Value

Environment

at line 49
__construct(string $name)

Environment constructor.

Parameters

string $name

at line 65
array jsonSerialize()

{@inheritdoc}

Return Value

array

at line 88
array 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

array

at line 99
array 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

array

at line 123
string getName()

Return Value

string

at line 133
Environment setName(string $name)

Parameters

string $name

Return Value

Environment