[ 'product_id', 'remote_id', ], 'message' => 'The combination of Product ID and Remote ID has already been taken.', ], [ [ 'product_id' ], 'exist', 'skipOnError' => true, 'targetClass' => Product::className(), 'targetAttribute' => [ 'product_id' => 'id' ], ], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'product_id' => Yii::t('odoo', 'Product ID'), 'remote_id' => Yii::t('odoo', 'Remote ID'), ]; } /** * @return \yii\db\ActiveQuery */ public function getProduct() { return $this->hasOne(Product::className(), [ 'id' => 'product_id' ]); } }