$types
$types : array
The types for which we'll be handling adding inputs/filters.
This class adds default filters and validators to a field's input filter, depending upon its type.
createInputForField(\Dewdrop\Db\Field $field, array $metadata) : \Zend\InputFilter\Input
Examine the field's type and attach filters and validators accordingly.
\Dewdrop\Db\Field | $field | |
array | $metadata |
instantiateInput(\Dewdrop\Db\Field $field) : \Zend\InputFilter\Input
Instantiate an Input object for the supplied field call setAllowEmpty() depending upon whether the field is required.
\Dewdrop\Db\Field | $field |
attachForManyToMany(\Zend\InputFilter\Input $input) : \Zend\InputFilter\Input
The only reason we provide a special case for ManyToMany, really, is to avoid the normal integer filters/validators being applied to what will not be a scalar value.
\Zend\InputFilter\Input | $input |
attachForString(\Zend\InputFilter\Input $input) : \Zend\InputFilter\Input
Attach validators and filters for strings. If a length is specified in the DB metadata, we use that to add a StringLength validator. We always add filters to trim strings and convert empty strings to null.
\Zend\InputFilter\Input | $input |
attachForBoolean(\Zend\InputFilter\Input $input) : \Zend\InputFilter\Input
For booleans, we handle filtering differently depending upon whether the column is nullable in the DB. If it's nullable, we try to enable use of all three possible states (null, false and true) by filtering empty strings or null values to null and filtering other values ("0", 0, false, "1", etc.) to an integer of zero or one that can be used nicely with the DB to communicate the boolean value. If the DB column is not nullable, we convert all values to integers.
\Zend\InputFilter\Input | $input |