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