Blame view

common/models/Cart.php 1.77 KB
6c07dc8e   Mihail   add bills models,...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
  <?php
  
  namespace common\models;
  
  use Yii;
  
  /**
   * This is the model class for table "{{%cart}}".
   *
   * @property string $bill_id
   * @property string $account_id
   * @property string $count
   * @property double $price
   * @property double $price_purchase
   * @property integer $status
   * @property string $article
   * @property string $brand
   * @property string $descr
   * @property string $import_id
   * @property string $timestamp
   */
  class Cart extends \backend\components\base\BaseActiveRecord
  {
      /**
       * @inheritdoc
       */
      public static function tableName()
      {
          return '{{%cart}}';
      }
  
      /**
       * @inheritdoc
       */
      public function rules()
      {
          return [
              [['bill_id', 'account_id', 'count', 'price', 'price_purchase', 'article', 'brand', 'descr', 'import_id'], 'required'],
              [['bill_id', 'account_id', 'count', 'status', 'import_id'], 'integer'],
              [['price', 'price_purchase'], 'number'],
              [['timestamp'], 'safe'],
              [['article', 'brand'], 'string', 'max' => 100],
              [['descr'], 'string', 'max' => 254]
          ];
      }
  
      /**
       * @inheritdoc
       */
      public function attributeLabels()
      {
          return [
              'bill_id' => Yii::t('app', 'Bill ID'),
              'account_id' => Yii::t('app', 'Account ID'),
              'count' => Yii::t('app', 'Count'),
              'price' => Yii::t('app', 'Price'),
              'price_purchase' => Yii::t('app', 'Price Purchase'),
              'status' => Yii::t('app', 'Status'),
              'article' => Yii::t('app', 'Article'),
              'brand' => Yii::t('app', 'Brand'),
              'descr' => Yii::t('app', 'Descr'),
              'import_id' => Yii::t('app', 'Import ID'),
              'timestamp' => Yii::t('app', 'Timestamp'),
          ];
      }
  }