Пример #1
0
 /**
  * 
  * function val - This function checks if the value valid if isn't throw an exception.
  * 
  * @param null $val
  * @return void
  * @throws \SimplOn\DataValidationException
  */
 public function val($val = null)
 {
     if ($val) {
         if (in_array($val, $this->options)) {
             parent::val($val);
         } else {
             throw new \SimplOn\DataValidationException($this->valudationNotAnOption);
         }
     } else {
         return $this->val;
     }
 }