'\'%1$s\' is not less than \'%2$d\'' ); /** * Constructor * * @param array $options */ public function __construct($options = null) { parent::__construct($options); if (is_array($options)) { if (array_key_exists('max', $options)) { $this->setMax($options['max']); } } } /** * Returns true if and only if $value is less than max option * * @param string $value * @return boolean */ public function isValid($value) { if ($this->_max === null) { throw new Exception('Max is not set'); } if ($this->_max <= $value) { $this->addMessage(sprintf($this->_messageTemplates['not_less_than'], $value, $this->getMax())); return false; } return true; } /** * Sets the maximum value * * @param mixed $max * @return Quform_Validator_LessThan */ public function setMax($max) { $this->_max = $max; return $this; } /** * Get the maximum value * * @return mixed */ public function getMax() { return $this->_max; } }