class FieldType implements JsonSerializable

FieldType class.

This class is a representation of an item in a "fieldType" array in a UI extension.

// A single parameter for "simple" field types
$fieldType = new FieldType('Symbol');
$fieldType = new FieldType('Text');
$fieldType = new FieldType('Integer');
$fieldType = new FieldType('Number');
$fieldType = new FieldType('Date');
$fieldType = new FieldType('Boolean');
$fieldType = new FieldType('Object');

// Either ["Asset"] or ["Entry"] as second parameter, if "Link" is the first
$fieldType = new FieldType('Link', ['Asset']);
$fieldType = new FieldType('Link', ['Entry']);

// If the first parameter is "Array",
// then the second will have to be an array with the string "Symbol",
// or with the string "Link" and either "Entry" or "Asset"
$fieldType = new FieldType('Array', ['Symbol']);
$fieldType = new FieldType('Array', ['Link', 'Asset']);
$fieldType = new FieldType('Array', ['Link', 'Entry']);

Methods

__construct(string $type, array $options = [])

FieldType constructor.

array
jsonSerialize()

Returns an array to be used by "json_encode" to serialize objects of this class.

array
getData()

No description

Details

at line 53
__construct(string $type, array $options = [])

FieldType constructor.

Parameters

string $type
array $options

at line 80
array jsonSerialize()

Returns an array to be used by "json_encode" to serialize objects of this class.

Return Value

array

at line 161
array getData()

Return Value

array