Exemplo n.º 1
0
 /**
  * Constructor
  *
  * @param array $data
  * @param string $errorMessage
  * @throws \Ip\Exception
  */
 public function __construct($data, $errorMessage = null)
 {
     if (!is_array($data)) {
         throw new \Ip\Exception('InArray validator expect array of strings');
     }
     parent::__construct($data, $errorMessage);
 }
Exemplo n.º 2
0
 /**
  * Constructor
  *
  * @param array $data
  * @param string $errorMessage
  * @throws \Ip\Exception
  */
 public function __construct($data, $errorMessage = null)
 {
     if (empty($data['table'])) {
         throw new \Ip\Exception('Unique validator expect table name');
     }
     parent::__construct($data, $errorMessage);
 }
Exemplo n.º 3
0
 public function __construct($data = array(), $errorMessage = null)
 {
     $this->minLength = (int) $data;
     $this->errorMessage = $errorMessage;
     if (!is_numeric($data)) {
         throw new \Ip\Exception('minLength validator expect integer number as a first parameter');
     }
     parent::__construct($data, $errorMessage);
 }