BaseForm.php 299 B

123456789101112131415161718
  1. <?php
  2. namespace backend\forms;
  3. use yii\base\Model;
  4. use components\Exception;
  5. /**
  6. * Class BaseForm
  7. * @package backend\forms
  8. */
  9. class BaseForm extends Model
  10. {
  11. public function handleError()
  12. {
  13. $errors = $this->getFirstErrors();
  14. throw new Exception(1003, reset($errors));
  15. }
  16. }