ContentType
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
ContentType constructor.
Returns the name of this content type.
Returns all the fields of this content type as an associative array. The key is the ID of the field.
Returns the content type's description.
Returns the field for the passed id.
Returns the the display field of a content type. Commonly this is the title.
Returns the ID of this content type.
Returns the revision of this content type.
Returns the time when this content type was last updated.
Returns the time when this content type was created.
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.
at line 75
string
getName()
Returns the name of this content type.
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.
at line 99
string|null
getDescription()
Returns the content type's description.
at line 115
ContentTypeField|null
getField(string $fieldId)
Returns the field for the passed id.
If the field does not exist, null is returned.
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.
at line 149
string
getId()
Returns the ID of this content type.
at line 161
int
getRevision()
Returns the revision of this content type.
at line 173
DateTimeImmutable
getUpdatedAt()
Returns the time when this content type was last updated.
at line 185
DateTimeImmutable
getCreatedAt()
Returns the time when this content type was created.
at line 197
Space
getSpace()
Returns the space this content type belongs to.
at line 211
object
jsonSerialize()
Returns an object to be used by json_encode
to serialize objects of this class.