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