CakeValidationSet object. Holds all validation rules for a field and exposes methods to dynamically add or remove validation rules
__construct( string $fieldName , array $ruleSet )
Constructor
$fieldName $ruleSet _processValidationResponse( string $name , CakeValidationRule $rule )
Fetches the correct error message for a failed validation
$name CakeValidationRule $rule string_translateArgs( array $args )
Applies translations to validator arguments.
$args arraycount( )
Returns the number of rules in this set
integerCountable::count() getIterator( )
Returns an iterator for each of the rules to be applied
ArrayIteratorIteratorAggregate::getIterator() getRule( string $name )
Gets a rule for a given name if exists
$name CakeValidationRulegetRules( )
Returns all rules for this validation set
CakeValidationRule[]offsetExists( string $index )
Returns whether an index exists in the rule set
$index booleanArrayAccess::offsetExists() offsetGet( string $index )
Returns a rule object by its index
$index CakeValidationRuleArrayAccess::offsetGet() offsetSet( string $index , CakeValidationRule|array $rule )
Sets or replace a validation rule.
This is a wrapper for ArrayAccess. Use setRule() directly for chainable access.
$index CakeValidationRule|array $rule ArrayAccess::offsetSet() offsetUnset( string $index )
Unsets a validation rule
$index ArrayAccess::offsetUnset() removeRule( string $name )
Removes a validation rule from the set
$set ->removeRule('required') ->removeRule('inRange')
$name selfsetMethods( array $methods )
Sets the list of methods to use for validation
$methods setRule( string $name , CakeValidationRule|array $rule )
Sets a CakeValidationRule $rule with a $name
$set ->setRule('required', array('rule' => 'notBlank', 'required' => true)) ->setRule('between', array('rule' => array('lengthBetween', 4, 10))
$name CakeValidationRule|array $rule selfsetRules( array $rules array() , boolean $mergeVars true )
Sets the rules for a given field
$set->setRules(array( 'required' => array('rule' => 'notBlank', 'required' => true), 'inRange' => array('rule' => array('between', 4, 10) ));
$rules optional array() $mergeVars optional true selfsetValidationDomain( string $validationDomain )
Sets the I18n domain for validation messages.
$validationDomain validate( array $data , boolean $isUpdate false )
Runs all validation rules in this set and returns a list of validation errors
$data $isUpdate optional false array
© 2005–2016 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
http://api.cakephp.org/2.7/class-CakeValidationSet.html