Example #1
0
 /**
  * @return ActiveQuery
  */
 public function getProductCategories()
 {
     return $this->hasMany(ProductCategory::className(), ['parent_id' => 'id']);
 }
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getProductCategory()
 {
     return $this->hasOne(ProductCategory::className(), ['id' => 'product_category_id']);
 }
 public function getCategory_name_with_cat_id()
 {
     return $this->hasOne(ProductCategory::className(), ['id' => 'cat_id']);
 }