/** * Handles the command. * * @param AddRejectReasonCommand $command */ public function handle($command) { $rejectReason = ''; $rejectReason = RejectReason::add($command->reason, $command->form_type, $command->process_type); //$addRejectReason = $this->rejectReasonRepo->save($rejectReason); if (!$this->rejectReasonRepo->reasonExists($command->reason, $command->form_type, $command->process_type)) { $addRejectReason = $this->rejectReasonRepo->save($rejectReason); return $addRejectReason; } }
/** * Handles the command. * * @param EditRejectReasonCommand $command */ public function handle($command) { $rejectReason = $this->rejectReasonRepo->getReasonByID($command->id); $rejectReason->reason = $command->reason; $rejectReason->form_type = $command->form_type; $rejectReason->process_type = $command->process_type; $saveEdit = $this->rejectReasonRepo->save($rejectReason); if ($saveEdit) { return $saveEdit; } }
/** * Export list of employees to Excel * * @return Excel */ public function export() { $rejectReasons = $this->rejectReasonRepo->getCSVReport(); $excel = new ExportToExcel($rejectReasons, 'List of Reject Reasons'); return $excel->export(); }
/** * Handles the command. * * @param RestoreRejectReasonCommand $command */ public function handle($command) { $rejectReasonRestore = $this->rejectReasonRepo->restore($command->id); return $rejectReasonRestore; }
/** * Handles the command. * * @param RemoveRejectReasonCommand $command */ public function handle($command) { $rejectReasonDelete = $this->rejectReasonRepo->remove($command->id); return $rejectReasonDelete; }