public function getProducts() { return $this->hasMany(Product::className(), ['id' => 'product_id'])->viaTable('{{%shop_product_to_category}}', ['category_id' => 'id'])->available(); }
public function getProduct() { return $this->hasOne(Product::className(), ['id' => 'product_id']); }