true, 'targetClass' => TaxOption::className(), 'targetAttribute' => ['dev_category_id' => 'tax_option_id']], [['product_id'], 'exist', 'skipOnError' => true, 'targetClass' => Product::className(), 'targetAttribute' => ['product_id' => 'product_id']], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'product_id' => Yii::t('product', 'Product'), 'dev_category_id' => Yii::t('product', 'Category'), ]; } public function getProduct() { return $this->getEntity1(); } public function getCategory() { return $this->getEntity2(); } }