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