true, 'targetClass' => Category::className(), 'targetAttribute' => [ 'category_id' => 'id' ], ], [ [ 'variant_option_group_excl_id' ], 'exist', 'skipOnError' => true, 'targetClass' => VariantOptionGroupExcl::className(), 'targetAttribute' => [ 'variant_option_group_excl_id' => 'id' ], ], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'variant_option_group_excl_id' => Yii::t('catalog', 'Variant Option Group Excl ID'), 'category_id' => Yii::t('catalog', 'Category ID'), ]; } /** * @return \yii\db\ActiveQuery */ public function getCategory() { return $this->hasOne(Category::className(), [ 'id' => 'category_id' ]) ->inverseOf('variantOptionGroupExclToCategories'); } /** * @return \yii\db\ActiveQuery */ public function getVariantOptionGroupExcl() { return $this->hasOne(VariantOptionGroupExcl::className(), [ 'id' => 'variant_option_group_excl_id' ]) ->inverseOf('variantOptionGroupExclToCategories'); } }