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

__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.

string
getId()

Returns the ID of the content type.

string
getName()

Returns the name of the content type.

string
getType()

Returns the type of the field.

string|null
getLinkType()

If the field is a link, this will return the type of the linked resource.

bool
isRequired()

Returns true if this field is required.

bool
isLocalized()

Returns true if the field contains locale dependent content.

bool
isDisabled()

True if the field is disabled.

string|null
getItemsType()

If the field is an array, this returns the type of its items.

string|null
getItemsLinkType()

If the field is an array, and it's items are links, this returns the type of the linked resources.

object
jsonSerialize()

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.

Parameters

string $id
string $name
string $type
string|null $linkType
string|null $itemsType
string|null $itemsLinkType
bool $required
bool $localized
bool $disabled

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.

Return Value

string

at line 144
string getName()

Returns the name of the content type.

This is a human friendly name shown to the user.

Return Value

string

at line 165
string getType()

Returns the type of the field.

Possible values are: - Symbol - Text - Integer - Number - Date - Boolean - Link - Array - Object

Return Value

string

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

Return Value

string|null

at line 189
bool isRequired()

Returns true if this field is required.

Return Value

bool

at line 199
bool isLocalized()

Returns true if the field contains locale dependent content.

Return Value

bool

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.

Return Value

bool

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

Return Value

string|null

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

Return Value

string|null

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