true, 'targetClass' => ProductVariant::className(), 'targetAttribute' => [ 'product_variant_id' => 'id' ], ], [ [ 'option_id' ], 'exist', 'skipOnError' => true, 'targetClass' => TaxOption::className(), 'targetAttribute' => [ 'option_id' => 'id' ], ], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'product_variant_id' => 'Product Variant ID', 'option_id' => 'Option ID', ]; } /** * @return \yii\db\ActiveQuery */ public function getProductVariant() { return $this->hasOne(ProductVariant::className(), [ 'id' => 'product_variant_id' ]); } /** * @return \yii\db\ActiveQuery */ public function getOption() { return $this->hasOne(TaxOption::className(), [ 'id' => 'option_id' ]); } }