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 134
protected
getSpaceId()
{@inheritdoc}
at line 142
protected
getEnvironmentId()
{@inheritdoc}
at line 150
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 84
getSystemProperties()
{@inheritdoc}
in UpdatableTrait at line 40
update()
Updates the current resource.
at line 76
__construct(string $name)
ContentType constructor.
at line 92
jsonSerialize()
{@inheritdoc}
at line 114
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 126
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 155
getName()
at line 163
ContentType
setName(string $name)
at line 173
string|null
getDescription()
at line 181
ContentType
setDescription(string $description = null)
at line 191
string|null
getDisplayField()
at line 199
ContentType
setDisplayField(string $displayField = null)
at line 209
FieldInterface[]
getFields()
at line 217
getField(string $fieldId)
at line 233
ContentType
setFields(array $fields)
at line 243
ContentType
addField(FieldInterface $contentTypeField)
at line 250
isPublished()
at line 263
addNewField(string $type, string $fieldId, string $name, array $params)
Adds a new content type field, and returns it.
at line 279
createField(string $type, string $fieldId, string $name, array $params)
Shortcut for creating a new field object.