<?php
 namespace Modules\RemoteData\EntityManagementWs\Model\Entity\ImportedOrder; class Matching extends \Modules\RemoteData\EntityManagementWs\Model\Entity\GeneralAbstract { protected $forcedRequestAttributes = ['orderIdSystem', 'externalSystemCode']; protected function checkRequestData() :void { if (!$this->request->orderIdSystem) { throw new \Modules\RemoteData\EntityManagementWs\Model\RuntimeException('No imported order ID set.', 'NoIdSet'); } if (!$this->request->externalSystemCode) { throw new \Modules\RemoteData\EntityManagementWs\Model\RuntimeException('No `externalSystemCode` set.', 'NoExternalSystemSet'); } } protected function processRequest() :void { $idExtSystem = \Entity\ExtResSystem::getSystemIdByCode($this->request->externalSystemCode); if (!$idExtSystem) { throw new \Modules\RemoteData\EntityManagementWs\Model\RuntimeException('Invalid `externalSystemCode` set.', 'InvalidExternalSystemSet'); } $impOrderDetails = \Entity\ImportedOrder::getDetailsByOrderExtSys($this->request->orderIdSystem, $idExtSystem, false); $this->response->idEntity = (int)$impOrderDetails['id']; } } 