sfValidatorSchema represents an array of fields.
Method Summary
-
asString()
@see sfValidatorBase
-
clean()
@see sfValidatorBase
-
configure($options, $messages)
Configures the validator.
-
doClean()
@see sfValidatorBase
-
getBytes()
-
sfValidatorBase
getFields()
Returns an array of fields.
-
sfValidatorBase
getPostValidator()
Returns the post validator.
-
sfValidatorBase
getPreValidator()
Returns the pre validator.
-
bool
offsetExists($name)
Returns true if the schema has a field with the given name (implements the ArrayAccess interface).
-
sfValidatorBase
offsetGet($name)
Gets the field associated with the given name (implements the ArrayAccess interface).
-
offsetSet($name, $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, $options, $messages)
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 , setMessage , setMessages , setOption , setOptions , __construct
Method Details
-
@see sfValidatorBase
-
@see sfValidatorBase
-
configure ($options, $messages)
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
-
@see sfValidatorBase
-
-
(sfValidatorBase) getFields ()
Browse code
Returns an array of fields.
returns An array of sfValidatorBase instances
-
(sfValidatorBase) getPostValidator ()
Browse code
Returns the post validator.
returns An sfValidatorBase instance
-
(sfValidatorBase) getPreValidator ()
Browse code
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
-
(sfValidatorBase) offsetGet ($name)
Browse code
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, $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, $options, $messages)
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
|