hasOne(VariantOptionGroupExcl::className(), [ 'id' => 'variant_option_group_excl_id' ]) ->inverseOf('variantOptionExcls'); } /** * @return \yii\db\ActiveQuery */ public function getVariantOptionExclLangs() { return $this->hasMany(VariantOptionExclLang::className(), [ 'variant_option_excl_id' => 'id' ]) ->inverseOf('variantOptionExcl'); } /** * @return \yii\db\ActiveQuery */ public function getLanguages() { return $this->hasMany(Language::className(), [ 'id' => 'language_id' ]) ->viaTable('variant_option_excl_lang', [ 'variant_option_excl_id' => 'id' ]); } /** * @return \yii\db\ActiveQuery */ public function getVariantOptionExclToCategories() { return $this->hasMany(VariantOptionExclToCategory::className(), [ 'variant_option_excl_id' => 'id' ]) ->inverseOf('variantOptionExcl'); } /** * @return \yii\db\ActiveQuery */ public function getCategories() { return $this->hasMany(Category::className(), [ 'id' => 'category_id' ]) ->viaTable('variant_option_excl_to_category', [ 'variant_option_excl_id' => 'id' ]); } /** * @return \yii\db\ActiveQuery */ public function getVariantToVariantOptionExcls() { return $this->hasMany(VariantToVariantOptionExcl::className(), [ 'variant_option_excl_id' => 'id' ]) ->inverseOf('variantOptionExcl'); } /** * @return \yii\db\ActiveQuery */ public function getVariants() { return $this->hasMany(Variant::className(), [ 'id' => 'variant_id' ]) ->viaTable('variant_to_variant_option_excl', [ 'variant_option_excl_id' => 'id' ]); } /** * Get exact Option Group id value * * @return int|null */ public function getGroupId() { return $this->variant_option_group_excl_id; } /** * Set Option Group link to Option model * * @param int $id * * @return void */ public function setGroupId(int $id) { $this->variant_option_group_excl_id = $id; } /** * Get Group query * * @return \yii\db\ActiveQuery */ public function getGroup(): ActiveQuery { return $this->getVariantOptionGroupExcl() ->inverseOf('options'); } }