class ContentType implements JsonSerializable

Content Types are schemas that define the fields of Entries. Every Entry can only contain values in the fields defined by it's Content Type, and the values of those fields must match the data type defined in the Content Type.

Methods

__construct(string $name, string|null $description, array $fields, string|null $displayField = null, SystemProperties $sys)

ContentType constructor.

string
getName()

Returns the name of this content type.

getFields()

Returns all the fields of this content type as an associative array. The key is the ID of the field.

string|null
getDescription()

Returns the content type's description.

getField(string $fieldId)

Returns the field for the passed id.

getDisplayField()

Returns the the display field of a content type. Commonly this is the title.

string
getId()

Returns the ID of this content type.

int
getRevision()

Returns the revision of this content type.

getUpdatedAt()

Returns the time when this content type was last updated.

getCreatedAt()

Returns the time when this content type was created.

getSpace()

Returns the space this content type belongs to.

object
jsonSerialize()

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

Details

at line 57
__construct(string $name, string|null $description, array $fields, string|null $displayField = null, SystemProperties $sys)

ContentType constructor.

Parameters

string $name
string|null $description
array $fields
string|null $displayField
SystemProperties $sys

at line 75
string getName()

Returns the name of this content type.

Return Value

string

at line 87
ContentTypeField[] getFields()

Returns all the fields of this content type as an associative array. The key is the ID of the field.

Return Value

ContentTypeField[]

at line 99
string|null getDescription()

Returns the content type's description.

Return Value

string|null

at line 115
ContentTypeField|null getField(string $fieldId)

Returns the field for the passed id.

If the field does not exist, null is returned.

Parameters

string $fieldId

Return Value

ContentTypeField|null

at line 133
ContentTypeField|null getDisplayField()

Returns the the display field of a content type. Commonly this is the title.

Returns null if not display field is set.

Return Value

ContentTypeField|null

at line 149
string getId()

Returns the ID of this content type.

Return Value

string

at line 161
int getRevision()

Returns the revision of this content type.

Return Value

int

at line 173
DateTimeImmutable getUpdatedAt()

Returns the time when this content type was last updated.

Return Value

DateTimeImmutable

at line 185
DateTimeImmutable getCreatedAt()

Returns the time when this content type was created.

Return Value

DateTimeImmutable

at line 197
Space getSpace()

Returns the space this content type belongs to.

Return Value

Space

at line 211
object jsonSerialize()

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

Return Value

object

See also

http://php.net/manual/en/jsonserializable.jsonserialize.php JsonSerializable::jsonSerialize