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 60
__construct(string $name, string|null $description, array $fields, string|null $displayField, SystemProperties $sys)
ContentType constructor.
at line 76
string
getName()
Returns the name of this content type.
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.
at line 96
string|null
getDescription()
Returns the content type's description.
at line 110
ContentTypeField|null
getField(string $fieldId)
Returns the field for the passed id.
If the field does not exist, null is returned.
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.
at line 140
string
getId()
Returns the ID of this content type.
at line 150
int
getRevision()
Returns the revision of this content type.
at line 160
DateTimeImmutable
getUpdatedAt()
Returns the time when this content type was last updated.
at line 170
DateTimeImmutable
getCreatedAt()
Returns the time when this content type was created.
at line 180
Space
getSpace()
Returns the space this content type belongs to.
at line 192
object
jsonSerialize()
Returns an object to be used by json_encode
to serialize objects of this class.