From 63e9dd1644fe9ecdc74d76ac91462b2730248346 Mon Sep 17 00:00:00 2001 From: mokaddem Date: Mon, 14 Jun 2021 13:25:49 +0200 Subject: [PATCH] chg: [genericRequestProcessor] Changed signature of `process` function --- .../default/RequestProcessors/BroodRequestProcessor.php | 2 +- .../default/RequestProcessors/GenericRequestProcessor.php | 2 +- .../default/RequestProcessors/LocalToolRequestProcessor.php | 6 +++--- .../default/RequestProcessors/ProposalRequestProcessor.php | 2 +- .../RequestProcessors/SynchronisationRequestProcessor.php | 2 +- .../RequestProcessors/TemplateRequestProcessor.php.template | 2 +- .../default/RequestProcessors/UserRequestProcessor.php | 2 +- src/Controller/InboxController.php | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libraries/default/RequestProcessors/BroodRequestProcessor.php b/libraries/default/RequestProcessors/BroodRequestProcessor.php index b598705..0ea01bb 100644 --- a/libraries/default/RequestProcessors/BroodRequestProcessor.php +++ b/libraries/default/RequestProcessors/BroodRequestProcessor.php @@ -43,7 +43,7 @@ class ToolInterconnectionProcessor extends BroodRequestProcessor implements Gene return parent::create($requestData); } - public function process($id, $requestData) + public function process($id, $requestData, $inboxRequest) { $connectionSuccessfull = false; $interConnectionResult = []; diff --git a/libraries/default/RequestProcessors/GenericRequestProcessor.php b/libraries/default/RequestProcessors/GenericRequestProcessor.php index 5176b24..1bfd974 100644 --- a/libraries/default/RequestProcessors/GenericRequestProcessor.php +++ b/libraries/default/RequestProcessors/GenericRequestProcessor.php @@ -8,7 +8,7 @@ use Cake\View\ViewBuilder; interface GenericProcessorActionI { public function create($requestData); - public function process($requestID, $serverRequest); + public function process($requestID, $serverRequest, $inboxRequest); public function discard($requestID ,$requestData); } diff --git a/libraries/default/RequestProcessors/LocalToolRequestProcessor.php b/libraries/default/RequestProcessors/LocalToolRequestProcessor.php index e73c60c..0406779 100644 --- a/libraries/default/RequestProcessors/LocalToolRequestProcessor.php +++ b/libraries/default/RequestProcessors/LocalToolRequestProcessor.php @@ -113,7 +113,7 @@ class IncomingConnectionRequestProcessor extends LocalToolRequestProcessor imple ]; } - public function process($id, $requestData) + public function process($id, $requestData, $inboxRequest) { $connectionSuccessfull = false; $interConnectionResult = []; @@ -175,7 +175,7 @@ class AcceptedRequestProcessor extends LocalToolRequestProcessor implements Gene ]; } - public function process($id, $requestData) + public function process($id, $requestData, $inboxRequest) { $connectionSuccessfull = false; $interConnectionResult = []; @@ -232,7 +232,7 @@ class DeclinedRequestProcessor extends LocalToolRequestProcessor implements Gene ]; } - public function process($id, $requestData) + public function process($id, $requestData, $inboxRequest) { $connectionSuccessfull = false; $interConnectionResult = []; diff --git a/libraries/default/RequestProcessors/ProposalRequestProcessor.php b/libraries/default/RequestProcessors/ProposalRequestProcessor.php index 3421edf..7eab1c8 100644 --- a/libraries/default/RequestProcessors/ProposalRequestProcessor.php +++ b/libraries/default/RequestProcessors/ProposalRequestProcessor.php @@ -43,7 +43,7 @@ class ProposalEditProcessor extends ProposalRequestProcessor implements GenericP return parent::create($requestData); } - public function process($id, $requestData) + public function process($id, $requestData, $inboxRequest) { $proposalAccepted = false; $saveResult = []; diff --git a/libraries/default/RequestProcessors/SynchronisationRequestProcessor.php b/libraries/default/RequestProcessors/SynchronisationRequestProcessor.php index ae63ad5..b869e09 100644 --- a/libraries/default/RequestProcessors/SynchronisationRequestProcessor.php +++ b/libraries/default/RequestProcessors/SynchronisationRequestProcessor.php @@ -43,7 +43,7 @@ class DataExchangeProcessor extends SynchronisationRequestProcessor implements G return parent::create($requestData); } - public function process($id, $requestData) + public function process($id, $requestData, $inboxRequest) { $dataExchangeAccepted = false; $saveResult = []; diff --git a/libraries/default/RequestProcessors/TemplateRequestProcessor.php.template b/libraries/default/RequestProcessors/TemplateRequestProcessor.php.template index 6adb4c0..fb76d2c 100644 --- a/libraries/default/RequestProcessors/TemplateRequestProcessor.php.template +++ b/libraries/default/RequestProcessors/TemplateRequestProcessor.php.template @@ -43,7 +43,7 @@ class SCOPE_ACTION_Processor extends ProposalRequestProcessor implements Generic return parent::create($requestData); } - public function process($id, $requestData) + public function process($id, $requestData, $inboxRequest) { $proposalAccepted = false; $saveResult = []; diff --git a/libraries/default/RequestProcessors/UserRequestProcessor.php b/libraries/default/RequestProcessors/UserRequestProcessor.php index 3120bde..eee795e 100644 --- a/libraries/default/RequestProcessors/UserRequestProcessor.php +++ b/libraries/default/RequestProcessors/UserRequestProcessor.php @@ -80,7 +80,7 @@ class RegistrationProcessor extends UserRequestProcessor implements GenericProce ]; } - public function process($id, $requestData) + public function process($id, $requestData, $inboxRequest) { if ($requestData['individual_id'] == -1) { $individual = $this->Users->Individuals->newEntity([ diff --git a/src/Controller/InboxController.php b/src/Controller/InboxController.php index 66e6136..a4948aa 100644 --- a/src/Controller/InboxController.php +++ b/src/Controller/InboxController.php @@ -87,7 +87,7 @@ class InboxController extends AppController $processor = $this->requestProcessor->getProcessor($scope, $action); } if ($this->request->is('post')) { - $processResult = $processor->process($id, $this->request->getData()); + $processResult = $processor->process($id, $this->request->getData(), $request); return $processor->genHTTPReply($this, $processResult); } else { $renderedView = $processor->render($request, $this->request);