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, 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 60
__construct(string $name, string|null $description, array $fields, string|null $displayField, SystemProperties $sys)

ContentType constructor.

Parameters

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

at line 76
string getName()

Returns the name of this content type.

Return Value

string

at line 86
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 96
string|null getDescription()

Returns the content type's description.

Return Value

string|null

at line 110
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 126
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 140
string getId()

Returns the ID of this content type.

Return Value

string

at line 150
int getRevision()

Returns the revision of this content type.

Return Value

int

at line 160
DateTimeImmutable getUpdatedAt()

Returns the time when this content type was last updated.

Return Value

DateTimeImmutable

at line 170
DateTimeImmutable getCreatedAt()

Returns the time when this content type was created.

Return Value

DateTimeImmutable

at line 180
Space getSpace()

Returns the space this content type belongs to.

Return Value

Space

at line 192
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