Exemplo n.º 1
0
 /**
  * Returns a list of calendars
  *
  * @return array
  */
 function getChildren()
 {
     $calendars = $this->caldavBackend->getCalendarsForUser($this->principalInfo['uri']);
     $objs = [];
     foreach ($calendars as $calendar) {
         if ($this->caldavBackend instanceof Backend\SharingSupport) {
             if (isset($calendar['{http://calendarserver.org/ns/}shared-url'])) {
                 $objs[] = new SharedCalendar($this->caldavBackend, $calendar);
             } else {
                 $objs[] = new ShareableCalendar($this->caldavBackend, $calendar);
             }
         } else {
             $objs[] = new Calendar($this->caldavBackend, $calendar);
         }
     }
     if ($this->caldavBackend instanceof Backend\SchedulingSupport) {
         $objs[] = new Schedule\Inbox($this->caldavBackend, $this->principalInfo['uri']);
         $objs[] = new Schedule\Outbox($this->principalInfo['uri']);
     }
     // We're adding a notifications node, if it's supported by the backend.
     if ($this->caldavBackend instanceof Backend\NotificationSupport) {
         $objs[] = new Notifications\Collection($this->caldavBackend, $this->principalInfo['uri']);
     }
     // If the backend supports subscriptions, we'll add those as well,
     if ($this->caldavBackend instanceof Backend\SubscriptionSupport) {
         foreach ($this->caldavBackend->getSubscriptionsForUser($this->principalInfo['uri']) as $subscription) {
             $objs[] = new Subscriptions\Subscription($this->caldavBackend, $subscription);
         }
     }
     return $objs;
 }
Exemplo n.º 2
0
 /**
  * Returns a list of calendars
  *
  * @return array
  */
 public function getChildren()
 {
     $calendars = $this->caldavBackend->getCalendarsForUser($this->principalInfo['uri']);
     $objs = array();
     foreach ($calendars as $calendar) {
         if ($this->caldavBackend instanceof Backend\SharingSupport) {
             if (isset($calendar['{http://calendarserver.org/ns/}shared-url'])) {
                 $objs[] = new SharedCalendar($this->caldavBackend, $calendar);
             } else {
                 $objs[] = new ShareableCalendar($this->caldavBackend, $calendar);
             }
         } else {
             $objs[] = new Calendar($this->caldavBackend, $calendar);
         }
     }
     $objs[] = new Schedule\Outbox($this->principalInfo['uri']);
     // We're adding a notifications node, if it's supported by the backend.
     if ($this->caldavBackend instanceof Backend\NotificationSupport) {
         $objs[] = new Notifications\Collection($this->caldavBackend, $this->principalInfo['uri']);
     }
     return $objs;
 }