예제 #1
0
 /**
  * @param array $params
  * @throws Nomad_Exception if parameter is missing
  */
 public function __construct(array $params)
 {
     if (isset($params['expression'])) {
         $this->_expression = $params['expression'];
     } else {
         throw new Nomad_Exception('Regex validator must have "expression" in the validator array. ');
     }
     parent::__construct($params);
 }
 /**
  * @param array $params
  * @throws Nomad_Exception if parameter is missing
  */
 public function __construct(array $params)
 {
     if (isset($params['value'])) {
         $this->_value = $params['value'];
     } else {
         throw new Nomad_Exception('ValueGreaterThenOrEqualTo validator must have "number" in the validator array. e.g: "number"=>15');
     }
     if (!isset($this->_message)) {
         $this->_message = "Must be greater than or equal to {$this->_value}.";
     }
     parent::__construct($params);
 }
예제 #3
0
 /**
  * @param array $params
  * @throws Nomad_Exception if parameter is missing
  */
 public function __construct(array $params)
 {
     if (isset($params['value'])) {
         $this->_value = $params['value'];
     } else {
         throw new Nomad_Exception('ValueEqualTo validator must have "value" in the validator array. e.g: "value"=>"Nomad is great!"');
     }
     if (!isset($this->_message)) {
         $this->_message = "Must equal '{$this->_value}'.";
     }
     parent::__construct($params);
 }
예제 #4
0
 /**
  * @param array $params
  * @throws Nomad_Exception if parameter is missing
  */
 public function __construct(array $params)
 {
     if (isset($params['value'])) {
         $this->_value = $params['value'];
     } else {
         throw new Nomad_Exception('ValueLessThan validator must have "number" in the validator array. e.g: "number"=>15');
     }
     if (!isset($this->_message)) {
         $this->_message = "Must be less than {$this->_value}.";
     }
     parent::__construct($params);
 }
 /**
  * @param array $params
  * @throws Nomad_Exception if parameter is missing or not an integer
  */
 public function __construct(array $params = NULL)
 {
     if (isset($params['value'])) {
         if (is_int($params['value'])) {
             $this->_value = $params['value'];
         } else {
             throw new Nomad_Exception('LengthLessThanOrEqualTo validator "value" must be an integer, ' . gettype($params['value']) . ' given.');
         }
     } else {
         throw new Nomad_Exception('LengthLessThanOrEqualTo validator must have "value" in the validator array. e.g: "value"=>5');
     }
     if (!isset($this->_message)) {
         $this->_message = "Must be no longer than {$this->_value} characters.";
     }
     parent::__construct($params);
 }
예제 #6
0
 public function __construct($params = NULL)
 {
     parent::__construct($params);
 }