Ejemplo n.º 1
0
 /**
  * Run the Update
  *
  * @return mixed|void
  */
 public function call()
 {
     $pheal = $this->setScope('char')->getPheal();
     foreach ($this->api_info->characters as $character) {
         $result = $pheal->UpcomingCalendarEvents(['characterID' => $character->characterID]);
         foreach ($result->upcomingEvents as $event) {
             $event_info = UpcomingCalendarEvent::firstOrNew(['characterID' => $character->characterID, 'eventID' => $event->eventID]);
             $event_info->fill(['ownerID' => $event->ownerID, 'ownerName' => $event->ownerName, 'eventDate' => $event->eventDate, 'eventTitle' => $event->eventTitle, 'duration' => $event->duration, 'importance' => $event->importance, 'response' => $event->response, 'eventText' => $event->eventText, 'ownerTypeID' => $event->ownerTypeID]);
             $event_info->save();
         }
     }
     return;
 }
Ejemplo n.º 2
0
 /**
  * Get Calendar events for a specific character
  *
  * @param $character_id
  *
  * @return mixed
  */
 public function getCharacterUpcomingCalendarEvents($character_id)
 {
     return UpcomingCalendarEvent::where('characterID', $character_id)->get();
 }