Blame view

backend/components/base/BaseActiveRecord.php 576 Bytes
54ada04a   Mihail   add base classes ...
1
2
3
4
5
6
7
8
9
10
11
  <?php
  /**
   * Created by PhpStorm.
   * User: Cibermag
   * Date: 31.08.2015
   * Time: 10:02
   */
  
  namespace backend\components\base;
  
  
c4da20f0   Mihail   temp commit - tes...
12
13
14
15
  use yii\base\ErrorException;
  
  class BaseActiveRecord extends \yii\db\ActiveRecord {
  
61795805   Mihail   fixed testing iss...
16
      public  function throwStringErrorException($row = 0){
c4da20f0   Mihail   temp commit - tes...
17
18
  
          $errors_str = '';
61795805   Mihail   fixed testing iss...
19
20
21
          if ($row != 0) {
              $errors_str = "Ошибка в строке {$row} ";
          }
c4da20f0   Mihail   temp commit - tes...
22
23
24
25
26
27
28
          foreach ($this->getErrors() as $error) {
              $errors_str .= implode( array_values($error) );
          }
          throw new ErrorException( $errors_str );
      }
  
  }