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 booleancheckRequired( string $field , array $data )
Checks whether the field failed the field should be present validation
$field $data booleangetOptions( string|integer $key )
Returns passed options for this rule
$key array|nullgetValidationResult( )
Gets the validation error message
stringisEmptyAllowed( )
Returns whether the field can be left blank according to this rule
booleanisLast( )
Returns whether this rule should break validation process for associated field after it fails
booleanisRequired( )
Checks if the field is required according to the required property
booleanisUpdate( 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 booleanprocess( string $field , array $data , array $methods )
Dispatches the validation rule to the given validator method
$field $data $methods booleanreset( )
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