Validate.php
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.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Validate
- Version
- $Id: Validate.php 24593 2012-01-05 20:35:02Z matthew $
\Zend_Validate
- Implements
- \Zend_Validate_Interface
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties

array $_errors = array()array()Details- Type
- array
- Deprecated
- Since 1.5.0
Methods

addDefaultNamespaces(array | string $namespace) : nullAdds a new default namespace
| Name | Type | Description |
|---|---|---|
| $namespace | array | string |
| Type | Description |
|---|---|
| null |

addValidator(\Zend_Validate_Interface $validator, boolean $breakChainOnFailure = false) : \Zend_ValidateAdds 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.
| Name | Type | Description |
|---|---|---|
| $validator | \Zend_Validate_Interface | |
| $breakChainOnFailure | boolean |
| Type | Description |
|---|---|
| \Zend_Validate | Provides a fluent interface |

getDefaultTranslator( $translator = null) : \Zend_Translate_Adapter | nullReturns the default translation object
| Name | Type | Description |
|---|---|---|
| $translator |
| Type | Description |
|---|---|
| \Zend_Translate_Adapter | null |

getErrors() : arrayDefined by Zend_Validate_Interface
Returns array of validation failure message codes
| Type | Description |
|---|---|
| array |
- Deprecated
- Since 1.5.0

getMessageLength() : integerReturns the maximum allowed message length
| Type | Description |
|---|---|
| integer |

getMessages() : arrayDefined by Zend_Validate_Interface
Returns array of validation failure messages
| Type | Description |
|---|---|
| array |

hasDefaultNamespaces() : booleanReturns true when defaultNamespaces are set
| Type | Description |
|---|---|
| boolean |

is(mixed $value, string $classBaseName, array $args = array(), mixed $namespaces = array()) : boolean| Name | Type | Description |
|---|---|---|
| $value | mixed | |
| $classBaseName | string | |
| $args | array | OPTIONAL |
| $namespaces | mixed | OPTIONAL |
| Type | Description |
|---|---|
| boolean |
| Exception | Description |
|---|---|
| \Zend_Validate_Exception |

isValid(mixed $value) : booleanReturns 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).
| Name | Type | Description |
|---|---|---|
| $value | mixed |
| Type | Description |
|---|---|
| boolean |
| Exception | Description |
|---|---|
| \Zend_Validate_Exception | If validation of $value is impossible |

setDefaultNamespaces(array | string $namespace) : nullSets new default namespaces
| Name | Type | Description |
|---|---|---|
| $namespace | array | string |
| Type | Description |
|---|---|
| null |

setDefaultTranslator(\Zend_Translate | \Zend_Translate_Adapter | null $translator = null) : voidSets a default translation object for all validation objects
| Name | Type | Description |
|---|---|---|
| $translator | \Zend_Translate | \Zend_Translate_Adapter | null |