symfony API

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

sfValidatorFromDescription converts a string to a validator.

Inheritence

sfValidatorFromDescription  <  sfValidatorDecorator < sfValidatorBase

Method Summary

  • string asPhp()
    Returns a PHP representation for the validator.
  • array convertInfixToRpn($tokens)
    Converts a token array from an infix notation to a RPN.
  • getValidator()
    @see sfValidatorDecorator
  • array parseArguments($string, $i)
    Parses validator arguments.
  • mixed reduceTokens($tokens, $method)
    Reduces tokens to a single token and convert it with the given method.
  • array tokenize($string)
    Tokenizes a validator string to a list of tokens in RPN.
  • __construct()
    @see sfValidatorBase

Methods inherited from sfValidatorDecorator

asString , clean , doClean , getDefaultMessages , getDefaultOptions , getMessage , getMessages , getOption , getOptions , getValidator , hasOption , setMessage , setMessages , setOption , setOptions , __construct

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

  • (string) asPhp ()

    Returns a PHP representation for the validator.


    This PHP representation can be evaled to return the object validator.

    This is mainly useful to cache the result of the validator string parsing.

    returns The PHP representation for the validator

  • (array) convertInfixToRpn ($tokens)

    $tokens An array of tokens in infix notation

    Converts a token array from an infix notation to a RPN.

    returns An array of token in RPN

  • getValidator ()

    @see sfValidatorDecorator

  • (array) parseArguments ($string, $i)

    $string The string to parse
    $i The indice to start the parsing

    Parses validator arguments.

    returns An array of parameters

  • (mixed) reduceTokens ($tokens, $method)

    $tokens An array of tokens
    $method The method name to execute on each token

    Reduces tokens to a single token and convert it with the given method.

    returns A single validator representation

  • (array) tokenize ($string)

    $string A validator string

    Tokenizes a validator string to a list of tokens in RPN.

    returns An array of tokens

  • __construct ()

    @see sfValidatorBase