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.

jsonSerialize()

{@inheritdoc}

getData()

No description

Details

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

FieldType constructor.

Parameters

string $type
array $options

at line 77
jsonSerialize()

{@inheritdoc}

at line 139
getData()