abstract class Field implements IField
Base class that all Dat0r IField implementations should extend.
Provides a pretty complete implementation for the IField interface.
basic options: 'validator', 'valueholder', 'defaultvalue', 'mandatory'
Methods
static IField |
create(string $name, array $options = array())
Creates a new field instance. |
|
__construct(string $name, array $options = array())
Constructs a new field instance. |
||
string |
getName()
Returns the name of the field. |
|
array |
getOptions()
Returns the field's options. |
|
mixed |
getOption(string $name, mixed $default = null)
Returns a field option by name if it exists. |
|
boolean |
hasOption(string $name)
Tells if a field currently owns a specific option. |
|
IValueHolder |
getDefaultValue()
Returns the default value of the field. |
|
mixed |
getNullValue()
Returns a field's null value. |
|
string |
getValidator()
|
|
IValueHolder |
createValueHolder()
Creates a IValueHolder instance dedicated to the current field instance. |
Details
at line 49
static public IField
create(string $name, array $options = array())
Creates a new field instance.
at line 60
public
__construct(string $name, array $options = array())
Constructs a new field instance.
at line 71
public string
getName()
Returns the name of the field.
at line 81
public array
getOptions()
Returns the field's options.
at line 95
public mixed
getOption(string $name, mixed $default = null)
Returns a field option by name if it exists.
Otherwise an optional default is returned.
at line 107
public boolean
hasOption(string $name)
Tells if a field currently owns a specific option.
at line 117
public IValueHolder
getDefaultValue()
Returns the default value of the field.
at line 127
public mixed
getNullValue()
Returns a field's null value.
at line 138
public string
getValidator()
at line 176
public IValueHolder
createValueHolder()
Creates a IValueHolder instance dedicated to the current field instance.