Class ValidatorRuleInterface

Description

the ValidatorRuleInterface defines the methods required by any ValidatorRule

  • version: $Id: ValidatorRule.interface.php,v 1.6 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/ValidatorRule.interface.php (line 13)


	
			
Direct descendents
Class Description
AlwaysTrueValidatorRule an AlwaysTrueValidatorRule will always return valid for a given value
AndValidatorRule the AndValidatorRule takes 2 other rules and validates if both validate.
ArrayValidatorRuleWithRule an ArrayValidatorRuleWithRule will make sure that a value is both an array and passes a given rule for each value
BooleanValidatorRule the BooleanValidatorRule checks a given value to make sure it's a boolean value
ChoiceValidatorRule a ChoiceValidatorRule checks a value against a certain given number of choices
DoubleValidatorRule the DoubleValidatorRule checks a given value to make sure it's Double
ExtendsValidatorRule The ExtendsValidatorRule checks if a given object is extends a given class.
HasMethodsValidatorRule The ExtendsValidatorRule checks if a given object is extends a given class.
IntegerRangeValidatorRule the IntegerRangeValidatorRule checks a given value to make sure it's integer that falls within a certain range.
IntegerValidatorRule the IntegerValidatorRule checks a given value to make sure it's integer
NumericValidatorRule the NumericValidatorRule checks a given value to make sure it's numeric
OptionalRule The OptionalRule allows you to have a field where a rule is applied *only* when the value actually exists.
OrValidatorRule the OrValidatorRule takes 2 other rules and validates if at least one of the 2 validates.
RegexValidatorRule a RegexValidatorRule checks a given value against a regular expression
ResourceValidatorRule the ResourceValidatorRule checks a given value to make sure it's resource
StringValidatorRule the StringValidatorRule checks a given value to make sure it's string
TrueValidatorRule the TrueValidatorRule checks a given value to make sure it's true.
Method Summary
boolean check (mixed $val)
object ValidatorRule getRule ()
string getRuleKey ()
Methods
check (line 20)

checks a given value against the rule contained within the class

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

Redefined in descendants as:
getRule (line 37)

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 ()

Redefined in descendants as:
  • AlwaysTrueValidatorRule::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.
  • AndValidatorRule::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.
  • ArrayValidatorRuleWithRule::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.
  • 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.
  • BooleanValidatorRule::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.
  • ChoiceValidatorRule::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.
  • DoubleValidatorRule::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.
  • ExtendsValidatorRule::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.
  • HasMethodsValidatorRule::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.
  • IntegerRangeValidatorRule::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.
  • IntegerValidatorRule::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.
  • NumericValidatorRule::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.
  • OptionalRule::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.
  • OrValidatorRule::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.
  • RegexValidatorRule::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.
  • DottedPairValidatorRule::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.
  • CSSColorValidatorRule::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.
  • CSSFontFamilyValidatorRule::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.
  • CSSLengthValidatorRule::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.
  • CSSLengthValidatorRuleWithOptions::getRule() : Note: this class takes a parameter and may have several instantiations.
  • EmailValidatorRule::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.
  • FieldRequiredValidatorRule::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.
  • ResourceValidatorRule::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.
  • StringValidatorRule::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.
  • NonzeroLengthStringValidatorRule::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.
  • TrueValidatorRule::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 64)

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 ()

Redefined in descendants as:

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