FieldValidationTrait
trait FieldValidationTrait (View source)
Trait to add FieldValidator validation to a field, e.g. a DBField or FormField The field must implement FieldValidationInterface
Traits
Provides extensions to this object to integrate it with standard config API methods.
Config options
field_validators | array | FieldValidators configuration for the field |
Properties
Methods
Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).
Gets the uninherited value for the given config option
Get the value of this field for use in validation via FieldValidators
Details
static Config_ForClass
config()
Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).
mixed
uninherited(string $name)
Gets the uninherited value for the given config option
ValidationResult
validate()
Validate this field using FieldValidators
mixed
getValueForValidation()
Get the value of this field for use in validation via FieldValidators
Intended to be overridden in subclasses when there is a need to provide something different from the value of the field itself, for instance DBComposite and CompositeField which need to provide a value that is a combination of the values of their children