Advertisement
widana

Code

Jan 15th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1.         try {
  2.             DB::beginTransaction();
  3.            
  4.             $validator = Validator::make($dto, $this->rules());
  5.  
  6.             if ($validator->fails()) {
  7.                 throw new CoreException(ERROR_DATA_VALIDATION, [], $validator->errors());
  8.             }
  9.  
  10.             $modified_dto = $this->prepare($dto, $originalDto);
  11.             if($modified_dto != null) $dto = $modified_dto;
  12.             $result =  $this->process($dto, $originalDto);
  13.  
  14.             DB::commit();
  15.             return $result;
  16.         }catch(CoreException $ex){
  17.             DB::rollback();
  18.             throw $ex;
  19.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement