/** * @param Ticket $ticket * @param User $user * @param null $type * * @return bool */ public function scheduleTicket(Ticket $ticket, User $user, $type = null) { if (is_null($type)) { $type = 'estimated'; } $funcTime = 'get' . ucfirst(strtolower($type)) . 'Time'; $time = $ticket->{$funcTime}(); if ($time == 0) { return false; } if (is_null($ticket->getDueDate())) { return false; } try { $events = $this->googleApiService->schedule($user, $time, sprintf('[%s] #%d', $ticket->getProject()->getName(), $ticket->getId()), sprintf('https://projets.preview-app.net/project/%d/issues/kanban?issue=%d %s %s', $ticket->getProject()->getId(), $ticket->getId(), chr(10), $ticket->getDescription())); return $events; } catch (\Exception $e) { var_dump($e->getMessage()); } return false; }
/** * @return string */ public function getAgendaAuthUrl() { return $this->googleApiService->getAuthUrl(); }