phpDocumentor SForm
Rules
[ class tree: SForm ] [ index: SForm ] [ all elements ]

Class: SForm_Rule_Subset

Source Location: /SForm.php

Class SForm_Rule_Subset

Class Overview

Is the value in (or out of) this subset?

This rule determines if the returned value is in a given array, and returns the appropriate message. It can limit the returned values to those contained in the subset, or it can reject values in the subset using exclude().

Located in /SForm.php [line 2655]

SForm_Rule
   |
   --SForm_Rule_Subset

Properties

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From SForm_Rule

SForm_Rule::$elements
SForm_Rule::$hasParent
SForm_Rule::$jsElmNum
SForm_Rule::$jsElmVar
SForm_Rule::$message
SForm_Rule::$validateOnClient

Inherited From SForm_Rule

SForm_Rule::__construct()
Construct a rule with one element and one error message
SForm_Rule::assignParent()
Mark this rule as having a parent
SForm_Rule::createJSRule()
Create a basic if-then rule in JavaScript
SForm_Rule::escClient()
Escape client side variables
SForm_Rule::genJSValue()
Returns JS to get a value and save it in the local variable
SForm_Rule::isError()
Returns true if this element(s) fail validation
SForm_Rule::toJavaScript()
Get the JavaScript that should be run onsubmit
SForm_Rule::toString()
Returns a message describing the error and its cause
SForm_Rule::validateOnClient()
Should we run validation code on the client

[ Top ]
Property Summary
boolean   $exclusion   Are we excluding this subset?
array   $set   The set of values

[ Top ]
Method Summary
SForm_Rule_Subset   __construct()   Construct this rule
void   exclude()   Do we exclude this subset (instead of include them)?
boolean   isError()   Is the value in the set?
string   toJavaScript()   Generate JS to find if the value is in the set

[ Top ]
Properties
boolean   $exclusion = false [line 2665]

Are we excluding this subset?

If $exclusion is true, this rule will return an error if the element's value is in the given set.

API Tags:
Usedby:  SForm_Rule_Subset::exclude()
Access:  protected


[ Top ]
array   $set [line 2674]

The set of values

These values are compared against the element's value.

API Tags:
Access:  protected


[ Top ]
Methods
Constructor __construct  [line 2686]

  SForm_Rule_Subset __construct( string $message, SForm_Element $element, array $set  )

Construct this rule

The set of values should be an array such that a call to http://www.php.net/in_array will return the appropriate result.

Parameters:
string   $message:  Error message
object Element   $element:  to apply the message to.
array   $set:  Set of values


Redefinition of:
SForm_Rule::__construct()
Construct a rule with one element and one error message

[ Top ]
exclude  [line 2697]

  void exclude( [boolean $ex = true]  )

Do we exclude this subset (instead of include them)?

Parameters:
boolean   $ex:  Exclude these values from valid

API Tags:
Access:  public
Uses:  SForm_Rule_Subset::$exclusion


[ Top ]
isError  [line 2710]

  boolean isError( )

Is the value in the set?

If $exclusion is set to false (default), this returns false when the element's value is in the passed subset. Otherwise, if $exclusion is set to true, false is returned if the value is not in the array.


API Tags:
Return:  Results of http://www.php.net/in_array
Access:  public


Redefinition of:
SForm_Rule::isError()
Returns true if this element(s) fail validation

[ Top ]
toJavaScript  [line 2726]

  string toJavaScript( )

Generate JS to find if the value is in the set


API Tags:
Return:  JS code to validate the element
Access:  public
See:  SForm_Rule_Subset::isError()


Redefinition of:
SForm_Rule::toJavaScript()
Get the JavaScript that should be run onsubmit

[ Top ]

Documentation generated on Mon, 09 Apr 2007 19:08:52 -0500 by phpDocumentor 1.3.0