sfValidatorSchema represents an array of fields.
Method Summary
-
asString($indent)
-
clean($values)
-
configure($options = array(), $messages = array())
Configures the validator.
-
doClean($values)
-
getBytes($value)
-
getFields()
Returns an array of fields.
-
getPostValidator()
Returns the post validator.
-
getPreValidator()
Returns the pre validator.
-
bool
offsetExists($name)
Returns true if the schema has a field with the given name (implements the
ArrayAccess interface).
-
offsetGet($name)
Gets the field associated with the given name (implements the ArrayAccess
interface).
-
offsetSet($name, (sfValidatorBase) $validator)
Sets a field (implements the ArrayAccess interface).
-
offsetUnset($name)
Removes a field by name (implements the ArrayAccess interface).
-
postClean($values)
Cleans the input values.
-
preClean($values)
Cleans the input values.
-
setPostValidator($validator)
Sets the post validator.
-
setPreValidator($validator)
Sets the pre validator.
-
__clone()
-
__construct($fields = null, $options = array(), $messages = array())
Constructor.
addMessage , addOption , addRequiredOption , asString , clean , configure , doClean , getCharset , getDefaultMessages , getDefaultOptions , getEmptyValue , getErrorCodes , getMessage , getMessages , getMessagesWithoutDefaults , getOption , getOptions , getOptionsWithoutDefaults , getRequiredOptions , hasOption , isEmpty , setCharset , setDefaultMessages , setDefaultOptions , setInvalidMessage , setMessage , setMessages , setOption , setOptions , setRequiredMessage , __construct
Method Details
-
-
-
configure ($options = array(), $messages = array())
Browse code
| $options |
An array of options
|
| $messages |
An array of error messages
|
Configures the validator.
Available options: * allow_extra_fields: if false, the validator adds an error if extra fields are given in the input array of values (default to false)
* filter_extra_fields: if true, the validator filters extra fields from the returned array of cleaned values (default to true) Available error codes: * extra_fields
-
-
-
Returns an array of fields.
returns An array of sfValidatorBase instances
-
Returns the post validator.
returns An sfValidatorBase instance
-
Returns the pre validator.
returns A sfValidatorBase instance
-
(bool) offsetExists ($name)
Browse code
Returns true if the schema has a field with the given name (implements the
ArrayAccess interface).
returns true if the schema has a field with the given name, false otherwise
-
Gets the field associated with the given name (implements the ArrayAccess
interface).
returns The sfValidatorBase instance associated with the given name, null if it does not exist
-
offsetSet ($name, (sfValidatorBase) $validator)
Browse code
| $name |
The field name
|
| $validator |
An sfValidatorBase instance
|
Sets a field (implements the ArrayAccess interface).
-
Removes a field by name (implements the ArrayAccess interface).
-
Cleans the input values.
This method is the last validator executed by doClean(). It executes the validator returned by getPostValidator() on the global array of cleaned values.
throws sfValidatorError
-
Cleans the input values.
This method is the first validator executed by doClean(). It executes the validator returned by getPreValidator() on the global array of values.
throws sfValidatorError
-
setPostValidator ($validator)
Browse code
| $validator |
An sfValidatorBase instance
|
Sets the post validator.
-
setPreValidator ($validator)
Browse code
| $validator |
An sfValidatorBase instance
|
Sets the pre validator.
-
-
__construct ($fields = null, $options = array(), $messages = array())
Browse code
| $fields |
Initial fields
|
| $options |
An array of options
|
| $messages |
An array of error messages
|
Constructor.
The first argument can be: * null * an array of named sfValidatorBase instances
|