Esempio n. 1
0
 public function getSupporter()
 {
     if (is_null($this->getEventInfo())) {
         return $this->getEventInfo()->getSupporter();
     }
     return $this->eventManager->getSupporterByID($this->get('supporter'));
 }
Esempio n. 2
0
 public function eventByYearMonth(Request $request, Response $response, $args)
 {
     $year = intval($args["year"]);
     $month = intval($args["month"]);
     $eventMeta = $this->eventManager->getByYearMonth($year, $month);
     $event = $this->eventService->getEventById($eventMeta[0]['meetup_id']);
     $resWithETag = $this->cache->withETag($response, $eventMeta[0]['meetup_id']);
     $previousEvents = $this->eventService->getPastEvents();
     $this->view->render($response, 'event.twig', ['event' => $event, 'eventMeta' => $eventMeta[0], 'previousEvents' => $previousEvents]);
     return $resWithETag;
 }
Esempio n. 3
0
 /**
  * @param $userID
  * @return string
  * @throws \Exception
  */
 public function manageApprovedEvents($userID)
 {
     $events = $this->eventManager->getAllPendingEvents();
     if (count($events) > 0) {
         if ($this->joindinEventService->areEventsApproved($events)) {
             foreach ($events as $eventName => $event) {
                 // API call
                 /** @var EventModel $meetupEvent */
                 $meetupEvent = $this->getEventById($event->meetup_id);
                 $this->getMeetupEvent()->setEventID($event->meetup_id);
                 $this->event = $meetupEvent;
                 $this->joindinEventService->getJoindinEvent()->setEventLocation($event->uri);
                 if ($this->createJoindinTalk($userID)->getStatusCode() !== 201) {
                     throw new \Exception('Could not create Joindin Talk');
                 }
                 $this->updateEvents($eventName);
             }
         }
         return 'Created [' . count($events) . '] Talks';
     }
     return 'No pending events found.';
 }