CakeValidationRule object. Represents a validation method, error message and rules for applying such method to a field.
__construct( array $validator array() )
Constructor
$validator
optional array() _addValidatorProps( array $validator array() )
Sets the rule properties from the rule entry in validate
$validator
optional array() _getPropertiesArray( )
Gets an array with the rule properties
array
_parseRule( string $field , array $data )
Parses the rule and sets the rule and ruleParams
$field
$data
checkEmpty( string $field , array $data )
Checks if the allowEmpty key applies
$field
$data
boolean
checkRequired( string $field , array $data )
Checks whether the field failed the field should be present
validation
$field
$data
boolean
getOptions( string|integer $key )
Returns passed options for this rule
$key
array|null
getValidationResult( )
Gets the validation error message
string
isEmptyAllowed( )
Returns whether the field can be left blank according to this rule
boolean
isLast( )
Returns whether this rule should break validation process for associated field after it fails
boolean
isRequired( )
Checks if the field is required according to the required
property
boolean
isUpdate( boolean $exists null )
Sets the recordExists configuration value for this rule, ir refers to whether the model record it is validating exists exists in the collection or not (create or update operation)
If called with no parameters it will return whether this rule is configured for update operations or not.
$exists
optional null boolean
process( string $field , array $data , array $methods )
Dispatches the validation rule to the given validator method
$field
$data
$methods
boolean
reset( )
Resets internal state for this rule, by default it will become valid and it will set isUpdate() to false
skip( )
Checks if the validation rule should be skipped
boolean
© 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-CakeValidationRule.html