original_string: public function validate($model, $validators = null)
      {
          if (isset($validators) && is_array($validators)) {
              $validation = $this->validateArray($model, $validators);
          } else {
              $validation = $this->validateModel($model);
          }
          if ($validation) {
              $errors = $validation->validate($model);
              if (count($errors)) {
                  throw new ValidationException($errors);
              }
          }
      }
code: public function validate($model, $validators = null)
      {
          if (isset($validators) && is_array($validators)) {
              $validation = $this->validateArray($model, $validators);
          } else {
              $validation = $this->validateModel($model);
          }
          if ($validation) {
              $errors = $validation->validate($model);
              if (count($errors)) {
                  throw new ValidationException($errors);
              }
          }
      }
code_tokens: public function validate ( $ model , $ validators = null ) { if ( isset ( $ validators ) && is_array ( $ validators ) ) { $ validation = $ this -> validateArray ( $ model , $ validators ) ; } else { $ validation = $ this -> validateModel ( $ model ) ; } if ( $ validation ) { $ errors = $ validation -> validate ( $ model ) ; if ( count ( $ errors ) ) { throw new ValidationException ( $ errors ) ; } } }
docstring: Validate model object
  
  @param object|array $model
  @param array $validators
  @throws ValidationException
docstring_tokens: Validate model object