/** * Save event references to the DB * * @param string $eventName If null, use it through the event object * @return \PHPMinds\Model\Event\Entity\Event */ public function updateEvents($eventName = null) { $eventName = $eventName ?? $this->event->getName(); $eventEntity = new \PHPMinds\Model\Event\Entity\Event($this->meetupService->getMeetupEvent()->getMeetupEventID(), $this->event->getVenue()->getId(), $eventName, $this->joindinEventService->getJoindinEvent()->getTalkID(), $this->joindinEventService->getJoindinEvent()->getTalkUrl(), $this->event->getTalk()->getSpeaker()->getId(), $this->event->getSupporter()->getId(), $this->event->getDate()); $this->eventManager->saveEvent($eventEntity); return $eventEntity; }
/** * @param EventModel $event * @param string $language * @return array */ public function getCreateEventTitlePayload(EventModel $event, $language = 'English - UK') { $speakers = [$event->getTalk()->getSpeaker()->getFirstName() . ' ' . $event->getTalk()->getSpeaker()->getLastName()]; $payload = ['talk_title' => $event->getTalk()->getTitle(), 'talk_description' => $event->getTalk()->getDescription(), 'language' => $language, 'talk_type' => 'Talk', 'start_date' => $event->getDate()->setTimezone(new \DateTimeZone('UTC'))->format('Y-m-d H:i:s'), 'speakers' => $speakers]; return $payload; }
/** * @param EventModel $event * @return array */ public function getCreateEventPayload(EventModel $event) { // x-www-form-urlencoded // have not tried using json $payload = ['name' => $event->getTalk()->getTitle(), 'description' => $event->getTalk()->getDescription(), 'venue_id' => $event->getVenue()->getId(), 'publish_status' => $this->publishStatus, 'time' => $event->getDate()->getTimestamp() * 1000, 'venue_visibility' => 'members']; if ($this->publishStatus !== 'draft') { unset($payload['publish_status']); } return $payload; }