Blame view

app/models/Type.php 540 Bytes
bf807468   Alex Savenko   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  <?php

  

  namespace app\models;

  use app\models\ProductsType;

  

  class Type extends \yii\db\ActiveRecord

  {

      public static function tableName()

      {

          return 'catalog_type';

      }

      

          public function getProductsType()

          {

              return $this->hasMany(ProductsType::className(), ['type_id' => 'id']);

          }      

          public function getProductsFasovka()

          {

              return $this->hasMany(ProductsFasovka::className(), ['product_id'=>'ProductsType.product_id']);

          }     

  }