apidoc
[ class tree: apidoc ] [ index: apidoc ] [ all elements ]

Class: Structures_Form_Rule_NumericRange

Source Location: /Structures_Form-0.8.0devel/Form/Rule/NumericRange.php

Class Overview

Structures_Form_Rule_Base
   |
   --Structures_Form_Rule_Regex
      |
      --Structures_Form_Rule_Numeric
         |
         --Structures_Form_Rule_NumericRange



Variables

Methods


Inherited Variables

Inherited Methods

Class: Structures_Form_Rule_Numeric

Structures_Form_Rule_Numeric::__construct()
Constructor.

Class: Structures_Form_Rule_Regex

Structures_Form_Rule_Regex::__construct()
Constructor.
Structures_Form_Rule_Regex::setRegex()
Sets the regular expression to be used for validation.
Structures_Form_Rule_Regex::validate()
Validates the given element.

Class: Structures_Form_Rule_Base

Structures_Form_Rule_Base::__construct()
Constructor.
Structures_Form_Rule_Base::addSubstitution()
Adds a new subsitution to the substitution array.
Structures_Form_Rule_Base::generateErrorString()
Generates an error string based on the class' error string and the class' substitution array.
Structures_Form_Rule_Base::removeSubstitution()
Removes a subsitution from the substitution array.
Structures_Form_Rule_Base::setErrorMessage()
Sets the error message to be used when a value fails to validate.
Structures_Form_Rule_Base::setSubstitutions()
Sets the array of error message substitutions.

Class Details

[line 23]


[ Top ]


Class Variables

$errorMessage =  '{elementName} must be a number {min}{and}{max}.'

[line 34]

The error message to be returned if the element does not validate.

The values in {curly braces} will be substituted for values from the substitiution array.

  • Access: protected

Type:   string
Overrides:   Array


[ Top ]

$max =

[line 50]

The maximum value for the element.
  • Access: protected

Type:   float


[ Top ]

$min =

[line 42]

The minimum value for the element.
  • Access: protected

Type:   float


[ Top ]



Method Detail

__construct (Constructor)   [line 67]

void __construct( float $min, float $max, [string $errorMessage = null], [array $substitutions = null])

Constructor. Calls the parent constructor then sets up the min and max values.

This rule does not require any additional arguments, but may accept two optional arguments.

  • Throws: Structures_Form_Exception
  • Access: public

Overrides Structures_Form_Rule_Numeric::__construct() (Constructor.)

Parameters:

float   $min   —  The lower limit.
float   $max   —  The upper limit.
string   $errorMessage   —  Optional error message.
array   $substitutions   —  Optional substitution array.

[ Top ]

validate   [line 132]

mixed validate( Structures_Form_ElementInterface $element)

Validates the given element.
  • Return: true if the value is ok, an error message otherwise.
  • Access: public

Overrides Structures_Form_Rule_Regex::validate() (Validates the given element.)

Parameters:

object   $element   —  A Structures_Form element.

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:44:13 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.