Blame view

artweb/artbox-catalog/models/Import.php 2.03 KB
16f1e516   mzavalniuk   add artbox-catalo...
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
67
68
69
70
71
72
73
74
75
76
77
78
79
  <?php
      
      namespace artbox\catalog\models;
      
      use artbox\core\models\Image;
      use yii\db\ActiveRecord;
      
      /**
       * Class Import
       *
       * @package artbox\catalog\models
       * @property string       $category_name
       * @property string       $brand_name
       * @property string       $image_link
       * @property string       $image_name
       * @property string       $sku
       * @property string       $product_name
       * @property Image        $image
       * @property Variant      $variant
       * @property CategoryLang $categoryLang
       * @property BrandLang    $brandLang
       * @property string       $description
       * @property double       $price
       * @property double       $price_old
       * @property integer      $stock
       * @property integer      $mask
       * @property string       $video
       * @property string       $characteristics
       */
      class Import extends ActiveRecord
      {
          public $categoryId = null;
      
          public $brandId = null;
      
          public $imageId = null;
      
          public $groups = [];
          
          /**
           * @inheritdoc
           */
          public static function tableName()
          {
              return 'import';
          }
      
          /**
           * @return \yii\db\ActiveQuery
           */
          public function getVariant()
          {
              return $this->hasOne(Variant::className(), [ 'sku' => 'sku' ]);
          }
      
          /**
           * @return \yii\db\ActiveQuery
           */
          public function getCategoryLang()
          {
              return $this->hasOne(CategoryLang::className(), [ 'title' => 'category_name' ]);
          }
      
          /**
           * @return \yii\db\ActiveQuery
           */
          public function getBrandLang()
          {
              return $this->hasOne(BrandLang::className(), [ 'title' => 'brand_name' ]);
          }
      
          /**
           * @return \yii\db\ActiveQuery
           */
          public function getImage()
          {
              return $this->hasOne(Image::className(), [ 'fileName' => 'image_name' ]);
          }
      }