Fully Qualified Name: | Zend\Validator\ValidatorChain |
Implements: | Countable, ValidatorInterface |
Name | Description | Defined By |
---|---|---|
__clone() | Deep clone handling | ValidatorChain |
__construct() | Initialize validator chain | ValidatorChain |
__invoke() | Invoke chain as command | ValidatorChain |
__sleep() | Prepare validator chain for serialization | ValidatorChain |
addByName() | Proxy to attachByName() to keep BC | ValidatorChain |
addValidator() | Proxy to attach() to keep BC | ValidatorChain |
attach() | Attach a validator to the end of the chain | ValidatorChain |
attachByName() | Use the plugin manager to add a validator by name | ValidatorChain |
count() | Return the count of attached validators | ValidatorChain |
getMessages() | Returns array of validation failure messages | ValidatorChain |
getPluginManager() | Get plugin manager instance | ValidatorChain |
getValidators() | Get all the validators | ValidatorChain |
isValid() | Returns true if and only if $value passes all validations in the chain | ValidatorChain |
merge() | Merge the validator chain with the one given in parameter | ValidatorChain |
plugin() | Retrieve a validator by name | ValidatorChain |
prependByName() | Use the plugin manager to prepend a validator by name | ValidatorChain |
prependValidator() | Adds a validator to the beginning of the chain | ValidatorChain |
setPluginManager() | Set plugin manager instance | ValidatorChain |
Deep clone handling
Returns:
Initialize validator chain
Returns:
Invoke chain as command
Parameter Name | Type | Description |
---|---|---|
$value | mixed |
Returns: bool
Prepare validator chain for serialization
Plugin manager (property 'plugins') cannot be serialized. On wakeup the property remains unset and next invocation to getPluginManager() sets the default plugin manager instance (ValidatorPluginManager).
Returns: array
Proxy to attachByName() to keep BC
Parameter Name | Type | Description |
---|---|---|
$name | string | |
$options | array | |
$breakChainOnFailure | bool |
Returns: \ValidatorChain
Proxy to attach() to keep BC
Parameter Name | Type | Description |
---|---|---|
$validator | \ValidatorInterface | |
$breakChainOnFailure | bool | |
$priority | int |
Returns: \ValidatorChain Provides a fluent interface
Attach 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.
Parameter Name | Type | Description |
---|---|---|
$validator | \ValidatorInterface | |
$breakChainOnFailure | bool | |
$priority | int | Priority |
Returns: self
Use the plugin manager to add a validator by name
Parameter Name | Type | Description |
---|---|---|
$name | string | |
$options | array | |
$breakChainOnFailure | bool | |
$priority | int |
Returns: \ValidatorChain
Return the count of attached validators
Returns: int
Returns array of validation failure messages
Returns: array
Get plugin manager instance
Returns: \ValidatorPluginManager
Get all the validators
Returns: array
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).
Parameter Name | Type | Description |
---|---|---|
$value | mixed | |
$context | mixed | Extra |
Returns: bool
Merge the validator chain with the one given in parameter
Parameter Name | Type | Description |
---|---|---|
$validatorChain | \ValidatorChain |
Returns: \ValidatorChain
Retrieve a validator by name
Parameter Name | Type | Description |
---|---|---|
$name | string | Name |
$options | null|array | Options |
Returns: \ValidatorInterface
Use the plugin manager to prepend a validator by name
Parameter Name | Type | Description |
---|---|---|
$name | string | |
$options | array | |
$breakChainOnFailure | bool |
Returns: \ValidatorChain
Adds a validator to the beginning 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.
Parameter Name | Type | Description |
---|---|---|
$validator | \ValidatorInterface | |
$breakChainOnFailure | bool |
Returns: \ValidatorChain Provides a fluent interface
Set plugin manager instance
Parameter Name | Type | Description |
---|---|---|
$plugins | \ValidatorPluginManager | Plugin |
Returns: \ValidatorChain