Zend Framework  1.12
Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Zend_Validate Class Reference

Public Member Functions

 addValidator (Zend_Validate_Interface $validator, $breakChainOnFailure=false)
 Adds a validator to the end of the chain.
 
 isValid ($value)
 Returns true if and only if $value passes all validations in the chain.
 
 getMessages ()
 Defined by Zend_Validate_Interface.
 
 getErrors ()
 Defined by Zend_Validate_Interface.
 

Static Public Member Functions

static getDefaultNamespaces ()
 Returns the set default namespaces.
 
static setDefaultNamespaces ($namespace)
 Sets new default namespaces.
 
static addDefaultNamespaces ($namespace)
 Adds a new default namespace.
 
static hasDefaultNamespaces ()
 Returns true when defaultNamespaces are set.
 
static is ($value, $classBaseName, array $args=array(), $namespaces=array())
 
static getMessageLength ()
 Returns the maximum allowed message length.
 
static setMessageLength ($length=-1)
 Sets the maximum allowed message length.
 
static getDefaultTranslator ($translator=null)
 Returns the default translation object.
 
static setDefaultTranslator ($translator=null)
 Sets a default translation object for all validation objects.
 

Protected Attributes

 $_validators = array()
 
 $_messages = array()
 
 $_errors = array()
 

Static Protected Attributes

static $_defaultNamespaces = array()
 

Member Function Documentation

static addDefaultNamespaces (   $namespace)
static

Adds a new default namespace.

Parameters
array | string$namespace
Returns
null
addValidator ( Zend_Validate_Interface  $validator,
  $breakChainOnFailure = false 
)

Adds a validator to the end of the chain.

If $breakChainOnFailure is true, then if the validator fails, the next validator in the chain, if one exists, will not be executed.

Parameters
Zend_Validate_Interface$validator
boolean$breakChainOnFailure
Returns
Zend_Validate Provides a fluent interface
static getDefaultNamespaces ( )
static

Returns the set default namespaces.

Returns
array
static getDefaultTranslator (   $translator = null)
static

Returns the default translation object.

Returns
Zend_Translate_Adapter|null
getErrors ( )

Defined by Zend_Validate_Interface.

Returns array of validation failure message codes

Returns
array
Deprecated:
Since 1.5.0
static getMessageLength ( )
static

Returns the maximum allowed message length.

Returns
integer
getMessages ( )

Defined by Zend_Validate_Interface.

Returns array of validation failure messages

Returns
array

Implements Zend_Validate_Interface.

static hasDefaultNamespaces ( )
static

Returns true when defaultNamespaces are set.

Returns
boolean
static is (   $value,
  $classBaseName,
array  $args = array(),
  $namespaces = array() 
)
static
Parameters
mixed$value
string$classBaseName
array$argsOPTIONAL
mixed$namespacesOPTIONAL
Returns
boolean
Exceptions
Zend_Validate_Exception
isValid (   $value)

Returns true if and only if $value passes all validations in the chain.

Validators are run in the order in which they were added to the chain (FIFO).

Parameters
mixed$value
Returns
boolean

Implements Zend_Validate_Interface.

static setDefaultNamespaces (   $namespace)
static

Sets new default namespaces.

Parameters
array | string$namespace
Returns
null
static setDefaultTranslator (   $translator = null)
static

Sets a default translation object for all validation objects.

Parameters
Zend_Translate | Zend_Translate_Adapter | null$translator
static setMessageLength (   $length = -1)
static

Sets the maximum allowed message length.

Parameters
integer$length

Member Data Documentation

$_defaultNamespaces = array()
staticprotected
$_errors = array()
protected
$_messages = array()
protected
$_validators = array()
protected