API Documentation

Validate.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Validate
version
$Id: Validate.php 21340 2010-03-05 15:33:49Z thomas $
Classes
Zend_Validate

Description

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Zend_Validate

Implements
Zend_Validate_Interface
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Validate
Properties
$_validators
$_messages
$_defaultNamespaces
$_errors
Methods
addValidator
isValid
getMessages
getErrors
getDefaultNamespaces
setDefaultNamespaces
addDefaultNamespaces
hasDefaultNamespaces
is
getMessageLength
setMessageLength
getDefaultTranslator
setDefaultTranslator

Description

Properties

$_defaultNamespaces

array $_defaultNamespaces = 'array'

Default Namespaces

Details

$_defaultNamespaces
array
visibility
protected
default
array
final
false
static
true

$_errors

array $_errors = 'array'

Array of validation failure message codes

Details

$_errors
array
visibility
protected
default
array
final
false
static
false
deprecated
Since 1.5.0

$_messages

array $_messages = 'array'

Array of validation failure messages

Details

$_messages
array
visibility
protected
default
array
final
false
static
false

$_validators

array $_validators = 'array'

Validator chain

Details

$_validators
array
visibility
protected
default
array
final
false
static
false

Methods

addDefaultNamespaces

addDefaultNamespaces( array|string $namespace ) : null

Adds a new default namespace

Arguments
$namespace
arraystring
Output
null
Details
visibility
public
final
false
static
true

addValidator

addValidator( Zend_Validate_Interface $validator, boolean $breakChainOnFailure = false ) : Zend_Validate

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.

Arguments
$validator
Zend_Validate_Interface
$breakChainOnFailure
boolean
Output
Zend_Validate
Provides a fluent interface
Details
visibility
public
final
false
static
false

getDefaultNamespaces

getDefaultNamespaces( ) : array

Returns the set default namespaces

Output
array
Details
visibility
public
final
false
static
true

getDefaultTranslator

getDefaultTranslator(  $translator = null ) : Zend_Translate_Adapter|null

Returns the default translation object

Arguments
$translator
Details
visibility
public
final
false
static
true

getErrors

getErrors( ) : array

Defined by Zend_Validate_Interface

Returns array of validation failure message codes

Output
array
Details
visibility
public
final
false
static
false
deprecated
Since 1.5.0

getMessageLength

getMessageLength( ) : integer

Returns the maximum allowed message length

Output
integer
Details
visibility
public
final
false
static
true

getMessages

getMessages( ) : array

Defined by Zend_Validate_Interface

Returns array of validation failure messages

Output
array
Details
visibility
public
final
false
static
false

hasDefaultNamespaces

hasDefaultNamespaces( ) : boolean

Returns true when defaultNamespaces are set

Output
boolean
Details
visibility
public
final
false
static
true

is

is( mixed $value, string $classBaseName, array $args = array, mixed $namespaces = array ) : boolean

Arguments
$value
mixed
$classBaseName
string
$args
array
OPTIONAL
$namespaces
mixed
OPTIONAL
Output
boolean
Details
visibility
public
final
false
static
true
throws

isValid

isValid( mixed $value ) : boolean

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

Arguments
$value
mixed
Output
boolean
Details
visibility
public
final
false
static
false

setDefaultNamespaces

setDefaultNamespaces( array|string $namespace ) : null

Sets new default namespaces

Arguments
$namespace
arraystring
Output
null
Details
visibility
public
final
false
static
true

setDefaultTranslator

setDefaultTranslator( Zend_Translate|Zend_Translate_Adapter|null $translator = null ) :

Sets a default translation object for all validation objects

Arguments
$translator
Zend_TranslateZend_Translate_Adapternull
Details
visibility
public
final
false
static
true

setMessageLength

setMessageLength( integer $length = 1 ) :

Sets the maximum allowed message length

Arguments
$length
integer
Details
visibility
public
final
false
static
true
Documentation was generated by DocBlox.