Class AndValidatorRule

Description

the AndValidatorRule takes 2 other rules and validates if both validate.

  • version: $Id: AndValidatorRule.class.php,v 1.5 2007/09/04 20:25:55 adamfranco Exp $
  • license: GNU General Public License (GPL)
  • copyright: Copyright © 2005, Middlebury College

Located in /harmoni/core/utilities/FieldSetValidator/rules/AndValidatorRule.class.php (line 15)

ValidatorRuleInterface
   |
   --AndValidatorRule
Method Summary
void AndValidatorRule (object ValidatorRule $rule1, object ValidatorRule $rule2)
boolean check (mixed $val, mixed $rule1)
object ValidatorRule getRule (object ValidatorRule $rule1, object ValidatorRule $rule2)
string getRuleKey ()
Methods
Constructor AndValidatorRule (line 26)

the constructur

  • access: public
void AndValidatorRule (object ValidatorRule $rule1, object ValidatorRule $rule2)
  • object ValidatorRule $rule1: the first rule
  • object ValidatorRule $rule2: the second rule
check (line 39)

the AndValidatorRule takes 2 other rules and validates if at least one of the 2 validates.

  • return: TRUE, if validated; FALSE if not.
  • access: public
boolean check (mixed $val, mixed $rule1)
  • mixed $rule1: The first rule.

Redefinition of:
ValidatorRuleInterface::check()
checks a given value against the rule contained within the class
getRule (line 58)

This is a static method to return an already-created instance of a validator rule. There are at most about a hundred unique rule objects in use durring any given execution cycle, but rule objects are instantiated hundreds of thousands of times.

This method follows a modified Singleton pattern.

  • since: 3/28/05
  • static:
  • access: public
object ValidatorRule getRule (object ValidatorRule $rule1, object ValidatorRule $rule2)
  • object ValidatorRule $rule1: the first rule
  • object ValidatorRule $rule2: the second rule

Redefinition of:
ValidatorRuleInterface::getRule()
This is a static method to return an already-created instance of a validator rule. There are at most about a hundred unique rule objects in use durring any given execution cycle, but rule objects are instantiated hundreds of thousands of times.
getRuleKey (line 86)

Return a key that can be used to identify this Rule for caching purposes.

If this rule takes no arguments, the class name should be sufficient. otherwise, append the arguments.

This method should only be called by ValidatorRules.

  • since: 3/29/05
  • access: protected
string getRuleKey ()

Redefinition of:
ValidatorRuleInterface::getRuleKey()
Return a key that can be used to identify this Rule for caching purposes.

Inherited Methods

Inherited From ValidatorRuleInterface

ValidatorRuleInterface::check()
ValidatorRuleInterface::getRule()
ValidatorRuleInterface::getRuleKey()

Documentation generated on Wed, 19 Sep 2007 10:21:29 -0400 by phpDocumentor 1.3.0RC3