Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- DB::beginTransaction();
- $validator = Validator::make($dto, $this->rules());
- if ($validator->fails()) {
- throw new CoreException(ERROR_DATA_VALIDATION, [], $validator->errors());
- }
- $modified_dto = $this->prepare($dto, $originalDto);
- if($modified_dto != null) $dto = $modified_dto;
- $result = $this->process($dto, $originalDto);
- DB::commit();
- return $result;
- }catch(CoreException $ex){
- DB::rollback();
- throw $ex;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement