ContentTypeField
class ContentTypeField implements JsonSerializable
A ContentTypeField describes one field of a ContentType. This includes essential information for the display of the field's value.
Methods
ContentTypeField constructor.
Returns the ID of the content type.
Returns the name of the content type.
Returns the type of the field.
If the field is a link, this will return the type of the linked resource.
Returns true if this field is required.
Returns true if the field contains locale dependent content.
True if the field is disabled.
If the field is an array, this returns the type of its items.
If the field is an array, and it's items are links, this returns the type of the linked resources.
Returns an object to be used by json_encode
to serialize objects of this class.
Details
at line 112
__construct(string $id, string $name, string $type, string|null $linkType = null, string|null $itemsType = null, string|null $itemsLinkType = null, bool $required = false, bool $localized = false, bool $disabled = false)
ContentTypeField constructor.
at line 132
string
getId()
Returns the ID of the content type.
This is the internal identifier of the content type and is unique in the space.
at line 144
string
getName()
Returns the name of the content type.
This is a human friendly name shown to the user.
at line 165
string
getType()
Returns the type of the field.
Possible values are: - Symbol - Text - Integer - Number - Date - Boolean - Link - Array - Object
at line 179
string|null
getLinkType()
If the field is a link, this will return the type of the linked resource.
Possible values are: - Asset - Entry
at line 189
bool
isRequired()
Returns true if this field is required.
at line 199
bool
isLocalized()
Returns true if the field contains locale dependent content.
at line 211
bool
isDisabled()
True if the field is disabled.
Disabled fields are part of the API responses but not accessible trough the PHP SDK.
at line 231
string|null
getItemsType()
If the field is an array, this returns the type of its items.
Possible values are: - Symbol - Text - Integer - Number - Date - Boolean - Link - Object
at line 245
string|null
getItemsLinkType()
If the field is an array, and it's items are links, this returns the type of the linked resources.
Possible values are: - Asset - Entry
at line 257
object
jsonSerialize()
Returns an object to be used by json_encode
to serialize objects of this class.