/** * 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); }
/** * 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); }
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); }