Exemple #1
0
 /**
  * get all events apart form last one in array
  * @return array
  */
 public function getPastEvents($savedEvents = null)
 {
     $pastEvents = [];
     $events = $this->getEvents(['status' => 'past']);
     foreach ($events as $event) {
         if (!is_null($savedEvents)) {
             if (isset($savedEvents[$event['id']])) {
                 $pastEvents[] = EventFactory::getMergedFromArrays($this->meetupEvent->formatResponse($event), $savedEvents[$event['id']]);
             } else {
                 $pastEvents[] = EventFactory::getMergedFromArrays($this->meetupEvent->formatResponse($event), null);
             }
         } else {
             $pastEvents[] = EventFactory::getMergedFromArrays($this->meetupEvent->formatResponse($event), null);
         }
     }
     return $pastEvents;
 }
Exemple #2
0
 /**
  * @return \PHPMinds\Model\Event\EventModel
  */
 public function getAll()
 {
     $events = $this->meetupService->getAll();
     $eventDetails = $this->eventManager->getAllEventDetails();
     $result = [];
     foreach ($events as $event) {
         if (isset($eventDetails[$event['id']])) {
             $result[] = EventFactory::getMergedFromArrays($event, $eventDetails[$event['id']]);
         } else {
             $result[] = EventFactory::getMergedFromArrays($event, null);
         }
     }
     return $result;
 }