/** * Handles the command. * * @param CloseRequestCommand $command */ public function handle($command) { $onlineForm = $this->onlineFormRepository->getFormByFormableID($command->id); $onlineForm->stage = 0; $onlineForm->status = 1; $updateOnlineForm = $this->onlineFormRepository->save($onlineForm); if ($onlineForm->form_type == 'RequestForPayment' && $updateOnlineForm) { $closeForm = $this->rfpRepository->closeForm($onlineForm->formable_id); } return $this->onlineFormRepository->closeRequest($command->id); }