Class xPDOValidationRule

Description

The base validation rule class.

Located in /xpdo/validation/xpdovalidator.class.php (line 193)


	
			
Direct descendents
Class Description
 class xPDOMinLengthValidationRule The base validation rule class.
 class xPDOMaxLengthValidationRule The base validation rule class.
 class xPDOMinValueValidationRule The base validation rule class.
 class xPDOMaxValueValidationRule The base validation rule class.
 class xPDOObjectExistsValidationRule The base validation rule class.
 class xPDOForeignKeyConstraint The base validation rule class.
Variable Summary
 mixed $field
 mixed $message
 mixed $name
 mixed $validator
Method Summary
 xPDOValidationRule __construct (xPDOValidator &$validator, mixed $field, mixed $name, [string $message = ''])
 boolean isValid (mixed $value, [ $options = array()])
 void setMessage ([string $message = ''])
Variables
mixed $field = '' (line 195)
  • access: public
mixed $message = '' (line 197)
  • access: public
mixed $name = '' (line 196)
  • access: public
mixed $validator = null (line 194)
  • access: public
Methods
Constructor __construct (line 208)

Construct a new xPDOValidationRule instance.

  • return: The rule instance.
  • access: public
xPDOValidationRule __construct (xPDOValidator &$validator, mixed $field, mixed $name, [string $message = ''])
  • xPDOValidator &$validator: A reference to the xPDOValidator executing this rule.
  • mixed $field: The field being validated.
  • mixed $name: The identifying name of the validation rule.
  • string $message: An optional message for rule failure.
isValid (line 224)

The public method for executing a validation rule.

Extend this method to provide a reusable validation rule in your xPDOValidator instance.

  • return: True if the validation rule was passed, otherwise false.
  • access: public
boolean isValid (mixed $value, [ $options = array()])
  • mixed $value: The value of the field being validated.
  • array $options: Any options expected by the rule.

Redefined in descendants as:
setMessage (line 236)

Set the failure message for the rule.

  • access: public
void setMessage ([string $message = ''])
  • string $message: A message intended to convey the reason for rule failure.

Documentation generated on Fri, 17 Jun 2011 10:04:14 -0600 by phpDocumentor 1.4.3