__construct()
getMessage()
getName()
setMessage()
setMessages()
validate()
_execBetween()
_execMax()
_execMin()
_getMessage()
_getRange()
_init()
_isNoUserValue()
$_max
$_message
$_messages
$_min
$_name
Abstract implementation of range comparsion rules
category | Formagic |
---|---|
package | Rule |
subpackage | RangeComparsion |
author | Florian Sonnenburg |
copyright | Copyright (c) 2007-2011 Florian Sonnenburg |
version | $Id: Abstract.php 169 2012-05-06 20:16:16Z meweasle $ |
__construct(array $arguments)
The default error message that is displayed if the rule is violated can be overwritten by $errorMessage.
see | \self::_init() |
---|---|
inherited_from | \Formagic_Rule_Abstract::__construct() |
array
The rule options.
getMessage() : string
inherited_from | \Formagic_Rule_Abstract::getMessage() |
---|
string
Message stringgetName() : string
inherited_from | \Formagic_Rule_Abstract::getName() |
---|
string
The rule namesetMessage(string $message) : \Formagic_Rule_Abstract
Usually a rule will have one error message string that is used if the validation fails. If neccessary, Formagic_Rule_Abstract::_errorMessage can hold other variables, eg. an array of error messages for different outcomes of the validation process.
Implements a fluent interface pattern.
string
New message string
\Formagic_Exception |
---|
\Formagic_Rule_Abstract
$this object.validate(string $value) : boolean
Length rule checks if value is between min and max length. The validation method depends on $this->_type.
string
The item to checked
boolean
The validation result_execBetween(integer $range) : boolean
integer
Range value
boolean
Evaluation result_execMax(integer $range) : boolean
integer
Upper limit
boolean
Evaluation result_execMin(integer $range) : boolean
integer
Lower limit
boolean
Evaluation result_getMessage(string $key) : string
string
Message type
string
Translated filled message_getRange(string $value) : mixed
string
Item value
mixed
Check range value_init(array $arguments) : void
Allowed options for this rule are:
Will throw an exception, if neither "min" nor "max" option provided.
array
Array of arguments passed to __construct()
_isNoUserValue(\$value $value) : boolean
The value 0 (zero) for example could be something the user entered willingly and would be skipped from rule checks when using empty().
inherited_from | \Formagic_Rule_Abstract::_isNoUserValue() |
---|
\$value
mixed Value to be checked
boolean
$_max : integer
$_min : integer
$_name : string
inherited_from | \Formagic_Rule_Abstract::$$_name |
---|