symfony API

sfValidatorSchema Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.2 API OpenSearch

Packages

You are currently browsing the symfony API for the 1.2 version. Switch to:
This version of symfony is not maintained anymore.
If some of your projects still use this version, consider upgrading as soon as possible.

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.

Methods inherited from sfValidatorBase

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

  • asString ($indent) Browse code

    $indent

  • clean ($values) Browse code

    $values

  • 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

  • doClean ($values) Browse code

    $values

  • getBytes ($value) Browse code

    $value

  • getFields () Browse code

    Returns an array of fields.

    returns An array of sfValidatorBase instances

  • getPostValidator () Browse code

    Returns the post validator.

    returns An sfValidatorBase instance

  • getPreValidator () Browse code

    Returns the pre validator.

    returns A sfValidatorBase instance

  • (bool) offsetExists ($name) Browse code

    $name The field name

    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

  • offsetGet ($name) Browse code

    $name The field name

    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).

  • offsetUnset ($name) Browse code

    $name

    Removes a field by name (implements the ArrayAccess interface).

  • postClean ($values) Browse code

    $values The input values

    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

  • preClean ($values) Browse code

    $values The input values

    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.

  • __clone () Browse code

  • __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