symfony API

sfValidatorSchema Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

Packages

You are currently browsing the symfony API for the 1.4 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()
    @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.
  • sfValidatorBase setPostValidator($validator)
    Sets the post validator.
  • sfValidatorBase setPreValidator($validator)
    Sets the pre validator.
  • __clone()
  • __construct($fields, $options, $messages)
    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 , setDefaultMessage , setDefaultMessages , setDefaultOptions , setMessage , setMessages , setOption , setOptions , __construct

Method Details

  • asString ()

    @see sfValidatorBase

  • clean ()

    @see sfValidatorBase

  • configure ($options, $messages)

    $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 ()

    @see sfValidatorBase

  • getBytes ()

  • (sfValidatorBase) getFields ()

    Returns an array of fields.

    returns An array of sfValidatorBase instances

  • (sfValidatorBase) getPostValidator ()

    Returns the post validator.

    returns An sfValidatorBase instance

  • (sfValidatorBase) getPreValidator ()

    Returns the pre validator.

    returns A sfValidatorBase instance

  • (bool) offsetExists ($name)

    $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

  • (sfValidatorBase) offsetGet ($name)

    $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, $validator)

    $name The field name
    $validator An sfValidatorBase instance

    Sets a field (implements the ArrayAccess interface).

  • offsetUnset ($name)

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

  • postClean ($values)

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

    $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

  • (sfValidatorBase) setPostValidator ($validator)

    $validator An sfValidatorBase instance

    Sets the post validator.

    returns The current validator instance

  • (sfValidatorBase) setPreValidator ($validator)

    $validator An sfValidatorBase instance

    Sets the pre validator.

    returns The current validator instance

  • __clone ()

  • __construct ($fields, $options, $messages)

    $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