/** * @param string $title * @param string $typeId * @param string $shortDescription * @param string $longDescription * @param string $complexity * @param string $tags * @return string */ public function create($title, $typeId, $shortDescription, $longDescription, $complexity, $tags) { $event = $this->eventManager->findCurrentEvent(); $speaker = $this->authService->getLoggedUser(); try { $talk = $this->talkManager->create($event, $speaker, (int) $typeId, $title, $shortDescription, $longDescription, $complexity, !empty($tags) ? explode(',', $tags) : null); return json_encode(array('data' => array('id' => $talk->getId(), 'title' => $talk->getTitle()))); } catch (\InvalidArgumentException $error) { return json_encode(array('error' => $error->getMessage())); } catch (\PDOException $error) { return json_encode(array('error' => 'Não foi possível salvar os dados na camada de persistência')); } catch (\Exception $error) { return json_encode(array('error' => 'Erro interno no processamento da requisição')); } }
/** * @param string $redirectTo * @return string */ public function resendPayment($redirectTo) { return $this->handleExceptions(function (AttendeeRegistrationService $attendeeRegistrator, Event $event, User $user) use($redirectTo) { return $attendeeRegistrator->resendPayment($event, $user, $redirectTo); }, array($this->attendeeRegistrator, $this->eventManager->findCurrentEvent(), $this->authService->getLoggedUser())); }