/** * Registers a class definitions in container. */ public function registerDefinitions() { Yii::$container->set(ProductCategory::className(), ['as seo' => ['class' => 'im\\seo\\components\\SeoBehavior', 'metaClass' => 'im\\catalog\\models\\ProductCategoryMeta', 'ownerType' => false], 'as template' => ['class' => 'im\\cms\\components\\TemplateBehavior']]); Yii::$container->set(Product::className(), ['as seo' => ['class' => 'im\\seo\\components\\SeoBehavior', 'metaClass' => 'im\\catalog\\models\\ProductMeta', 'ownerType' => false]]); }
public function getCategoriesRelation() { return $this->hasMany(ProductCategory::className(), ['id' => 'category_id'])->viaTable('{{%products_categories}}', ['product_id' => 'id']); }
/** * @inheritdoc */ protected function getModelClass() { return ProductCategory::className(); }