コード例 #1
0
 /**
  * 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;
     }
 }
コード例 #2
0
 /**
  * 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;
     }
 }
コード例 #3
0
 /**
  * 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();
 }
コード例 #4
0
 /**
  * Handles the command.
  *
  * @param RestoreRejectReasonCommand $command
  */
 public function handle($command)
 {
     $rejectReasonRestore = $this->rejectReasonRepo->restore($command->id);
     return $rejectReasonRestore;
 }
コード例 #5
0
 /**
  * Handles the command.
  *
  * @param RemoveRejectReasonCommand $command
  */
 public function handle($command)
 {
     $rejectReasonDelete = $this->rejectReasonRepo->remove($command->id);
     return $rejectReasonDelete;
 }