/** * Returns a list of calendars * * @return array */ public function getChildren() { $calendars = $this->caldavBackend->getCalendarsForUser($this->principalInfo['uri']); $objs = array(); foreach ($calendars as $calendar) { $objs[] = new Sabre_CalDAV_Calendar($this->principalBackend, $this->caldavBackend, $calendar); } $objs[] = new Sabre_CalDAV_Schedule_Outbox($this->principalInfo['uri']); // We're adding a notifications node, if it's supported by the backend. if ($this->caldavBackend instanceof Sabre_CalDAV_Backend_NotificationSupport) { $objs[] = new Sabre_CalDAV_Notifications_Collection($this->caldavBackend, $this->principalInfo['uri']); } return $objs; }
/** * 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 Sabre_CalDAV_Backend_SharingSupport) { if (isset($calendar['{http://calendarserver.org/ns/}shared-url'])) { $objs[] = new Sabre_CalDAV_SharedCalendar($this->principalBackend, $this->caldavBackend, $calendar); } else { $objs[] = new Sabre_CalDAV_ShareableCalendar($this->principalBackend, $this->caldavBackend, $calendar); } } else { $objs[] = new Sabre_CalDAV_Calendar($this->principalBackend, $this->caldavBackend, $calendar); } } $objs[] = new Sabre_CalDAV_Schedule_Outbox($this->principalInfo['uri']); // We're adding a notifications node, if it's supported by the backend. if ($this->caldavBackend instanceof Sabre_CalDAV_Backend_NotificationSupport) { $objs[] = new Sabre_CalDAV_Notifications_Collection($this->caldavBackend, $this->principalInfo['uri']); } return $objs; }