class Field implements FieldInterface

Content type field

Properties

protected string $name Field name
protected string $type Field type
protected mixed $value Field value
protected string|null $title Field title(label)

Methods

__construct(string $name, string $type, string|null $title = null, mixed $value = null)

Constructor

string
getName()

Get field name

string|null
getTitle()

Get field title

string
getType()

Get field type

mixed
getValue()

Get field value

void
setValue(mixed $value)

Set field value

static FieldInterface
create(string $name, string $type, string|null $title = null, mixed $value = null)

Create field

static bool
isValidType(string $type)

Return true if field type is valid

Details

at line 56
__construct(string $name, string $type, string|null $title = null, mixed $value = null)

Constructor

Parameters

string $name
string $type
string|null $title
mixed $value

at line 73
string getName()

Get field name

Return Value

string

at line 83
string|null getTitle()

Get field title

Return Value

string|null

at line 93
string getType()

Get field type

Return Value

string

at line 103
mixed getValue()

Get field value

Return Value

mixed

at line 114
void setValue(mixed $value)

Set field value

Parameters

mixed $value

Return Value

void

at line 128
static FieldInterface create(string $name, string $type, string|null $title = null, mixed $value = null)

Create field

Parameters

string $name
string $type
string|null $title
mixed $value

Return Value

FieldInterface

at line 139
static bool isValidType(string $type)

Return true if field type is valid

Parameters

string $type

Return Value

bool