Class ArrayValidatorRuleWithRule

Description

an ArrayValidatorRuleWithRule will make sure that a value is both an array and passes a given rule for each value

  • version: $Id: ArrayValidatorRuleWithRule.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/ArrayValidatorRuleWithRule.class.php (line 15)

ValidatorRuleInterface
   |
   --ArrayValidatorRuleWithRule
Direct descendents
Class Description
ArrayValidatorRule an ArrayValidatorRule will check if a given value is an array
Variable Summary
object ValidatorRule $_rule
Method Summary
void ArrayValidatorRuleWithRule (object ValidatorRule $rule)
boolean check (mixed $val)
object ValidatorRule getRule (object ValidatorRule $rule)
string getRuleKey ()
Variables
object ValidatorRule $_rule (line 24)

the rule to be used for each array element

  • var: the rule
  • access: private
Methods
Constructor ArrayValidatorRuleWithRule (line 33)

the constructur

  • access: public
void ArrayValidatorRuleWithRule (object ValidatorRule $rule)
  • object ValidatorRule $rule: the rule to use for each array element
check (line 44)

checks a given value to make sure it's an array and then runs $this->_rule on each value

  • return: true if the check succeeds, false if it (guess...) fails.
  • access: public
boolean check (mixed $val)
  • mixed $val: the value to check

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

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 $rule)
  • object ValidatorRule $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.

Redefined in descendants as:
  • ArrayValidatorRule::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 96)

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:32 -0400 by phpDocumentor 1.3.0RC3