Esempio n. 1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCategories()
 {
     return $this->hasMany(Categories::className(), ['id' => 'category_id'])->viaTable(ProductsCategories::tableName(), ['product_id' => 'id']);
 }
Esempio n. 2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getProductsCategories()
 {
     return $this->hasMany(ProductsCategories::className(), ['category_id' => 'id']);
 }