示例#1
0
文件: Boolean.php 项目: addiks/phpsql
 public function validate($value)
 {
     parent::validate($value);
     if (!is_bool($value)) {
         throw new ErrorException("Value has to be boolean!");
     }
 }
示例#2
0
文件: Number.php 项目: addiks/phpsql
 public function validate($value)
 {
     parent::validate($value);
     if (!is_numeric($value)) {
         throw new ErrorException("Value has to be numeric!");
     }
 }
示例#3
0
文件: Text.php 项目: addiks/phpsql
 /**
  * Check for datatype string.
  * @param string $value
  * @throws  Exception\Error
  */
 protected function validate($value)
 {
     parent::validate($value);
     if (!is_string($value)) {
         throw new ErrorException("Value has to be text!");
     }
 }