ContentType
class ContentType extends BaseResource implements ContentTypeInterface, CreatableInterface
ContentType class.
This class represents a resource with type "ContentType" in Contentful.
Traits
Properties
protected ContentType | $sys | ||
Client | $client | from UpdatableTrait | |
protected string | $name | ||
protected string|null | $description | ||
protected string|null | $displayField | ||
protected FieldInterface[] | $fields | ||
protected bool | $isPublished |
Methods
{@inheritdoc}
{@inheritdoc}
{@inheritdoc}
Returns a ContentTypeSnapshot resource.
Returns a ResourceArray object which contains ContentTypeSnapshot resources.
{@inheritdoc}
ContentType constructor.
{@inheritdoc}
Returns an associative array where keys are the name of the fragments in a URI, and the values are the corresponding IDs.
Returns an array of headers that the current resource needs to sent for being created.
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Adds a new content type field, and returns it.
Shortcut for creating a new field object.
Details
in BaseResource at line 37
getId()
{@inheritdoc}
in BaseResource at line 45
getType()
{@inheritdoc}
in BaseResource at line 53
asLink()
{@inheritdoc}
in UpdatableTrait at line 35
abstract 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.
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.
at line 131
protected
getSpaceId()
{@inheritdoc}
at line 139
protected
getEnvironmentId()
{@inheritdoc}
at line 147
protected
getContentTypeId()
{@inheritdoc}
in ContentTypeProxyExtension at line 57
getSnapshot(string $snapshotId)
Returns a ContentTypeSnapshot resource.
in ContentTypeProxyExtension at line 72
getSnapshots(Query $query = null)
Returns a ResourceArray object which contains ContentTypeSnapshot resources.
in ContentTypeProxyExtension at line 87
getEditorInterface()
Returns an EditorInterface resource.
in DeletableTrait at line 28
delete()
Deletes the current resource.
in PublishableTrait at line 31
publish()
Publishes the current resource.
in PublishableTrait at line 41
unpublish()
Unpublishes the current resource.
at line 81
getSystemProperties()
{@inheritdoc}
in UpdatableTrait at line 40
update()
Updates the current resource.
at line 73
__construct(string $name)
ContentType constructor.
at line 89
jsonSerialize()
{@inheritdoc}
at line 111
string[]
asUriParameters()
Returns an associative array where keys are the name of the fragments in a URI, and the values are the corresponding IDs.
at line 123
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.
at line 152
getName()
at line 160
ContentType
setName(string $name)
at line 170
string|null
getDescription()
at line 178
ContentType
setDescription(string $description = null)
at line 188
string|null
getDisplayField()
at line 196
ContentType
setDisplayField(string $displayField = null)
at line 206
FieldInterface[]
getFields()
at line 214
getField(string $fieldId)
at line 230
ContentType
setFields(array $fields)
at line 240
ContentType
addField(FieldInterface $contentTypeField)
at line 247
isPublished()
at line 260
addNewField(string $type, string $fieldId, string $name, array $params)
Adds a new content type field, and returns it.
at line 276
createField(string $type, string $fieldId, string $name, array $params)
Shortcut for creating a new field object.