CakeValidationRule object. Represents a validation method, error message and rules for applying such method to a field.
$_passedOptions
protected array
$_recordExists
protected boolean
$_rule
protected mixed
$_ruleParams
protected array
$_valid
protected mixed
$allowEmpty
public boolean
$last
public boolean
$message
public string
$on
public string
$required
public mixed
$rule
public mixed
field should be present
validation Returns whether this rule should break validation process for associated field after it fails
required
property 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)
Resets internal state for this rule, by default it will become valid and it will set isUpdate() to false
__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
_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
checkRequired( string $field , array $data )
Checks whether the field failed the field should be present
validation
$field
$data
getOptions( string|integer $key )
Returns passed options for this rule
$key
getValidationResult( )
Gets the validation error message
isEmptyAllowed( )
Returns whether the field can be left blank according to this rule
isLast( )
Returns whether this rule should break validation process for associated field after it fails
isRequired( )
Checks if the field is required according to the required
property
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 process( string $field , array $data , array $methods )
Dispatches the validation rule to the given validator method
$field
$data
$methods
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
protected boolean
Holds whether the record being validated exists in datasource or not
false
© 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.8/class-CakeValidationRule.html