FieldDescriptor
in package
The FieldDescriptor class
Tags
Table of Contents
Properties
- $args : object
- The field arguments
- $default : mixed
- The field's default value
- $name : string
- The field name
- $nullable : bool
- Is this field nullable ?
- $type : string
- The field type
- $writable : bool
- Is this field writable ?
Methods
- __construct() : mixed
- Constructor
- __toString() : string
- Magic toString
- arg() : string|int|null
- Get arg value for this field
- buildIdField() : static
- Build ID field for an entity
- getDefault() : mixed
- Get the default value (if this field is NULL)
- getHtmlInputAttr() : array<string|int, string>
- Get the HTML input tag for this field
- getType() : AbstractTypeDescriptor
- Get the type of the field
- parseType() : FieldDescriptor
- Parse field type configuration from file string
Properties
$args
The field arguments
public
object
$args
$default
The field's default value
public
mixed
$default
$name
The field name
public
string
$name
$nullable
Is this field nullable ?
public
bool
$nullable
= false
$type
The field type
public
string
$type
$writable
Is this field writable ?
public
bool
$writable
= false
Methods
__construct()
Constructor
public
__construct(string $name, string $type, array<string|int, mixed> $rawArgs, mixed $default) : mixed
Parameters
- $name : string
- $type : string
- $rawArgs : array<string|int, mixed>
- $default : mixed
__toString()
Magic toString
public
__toString() : string
Return values
stringarg()
Get arg value for this field
public
arg(string $key) : string|int|null
Parameters
- $key : string
-
The argument key
Return values
string|int|null —The argument value
buildIdField()
Build ID field for an entity
public
static buildIdField(string $name) : static
Parameters
- $name : string
Return values
staticgetDefault()
Get the default value (if this field is NULL)
public
getDefault() : mixed
getHtmlInputAttr()
Get the HTML input tag for this field
public
getHtmlInputAttr() : array<string|int, string>
Tags
Return values
array<string|int, string>getType()
Get the type of the field
public
getType() : AbstractTypeDescriptor
Return values
AbstractTypeDescriptorparseType()
Parse field type configuration from file string
public
static parseType(string $fieldName, string|array<string|int, string> $desc) : FieldDescriptor
Parameters
- $fieldName : string
- $desc : string|array<string|int, string>
Tags
Return values
FieldDescriptor —The parsed field descriptor