39 $calendars = parent::getCalendarsForUser($principalUri);
45 if (!empty($this->shares[
$calendar[
'id']])) {
68 if (isset($this->notifications[$principalUri])) {
69 return $this->notifications[$principalUri];
86 foreach ($this->notifications[$principalUri] as
$key => $value) {
87 if ($notification === $value) {
88 unset($this->notifications[$principalUri][
$key]);
103 if (!isset($this->shares[$calendarId])) {
104 $this->shares[$calendarId] = [];
107 foreach ($sharees as $sharee) {
110 foreach ($this->shares[$calendarId] as $k => $existingSharee) {
111 if ($sharee->href === $existingSharee->href) {
116 $sharee = clone $sharee;
119 if ($sharee->access === DAV\Sharing\Plugin::ACCESS_NOACCESS) {
121 unset($this->shares[$calendarId][$existingKey]);
122 } elseif ($existingKey) {
124 $this->shares[$calendarId][$existingKey] = $sharee;
127 $this->shares[$calendarId][] = $sharee;
132 $this->shares[$calendarId] = array_values($this->shares[$calendarId]);
153 if (!isset($this->shares[$calendarId])) {
157 return $this->shares[$calendarId];
174 if ($status === DAV\Sharing\Plugin::INVITE_ACCEPTED) {
175 return 'calendars/blabla/calendar';
189 foreach ($this->calendars as $k => $cal) {
190 if ($cal[
'id'] === $calendarId) {
192 unset($cal[
'{http://calendarserver.org/ns/}publish-url']);
194 $cal[
'{http://calendarserver.org/ns/}publish-url'] =
'http://example.org/public/ ' . $calendarId .
'.ics';
200 throw new DAV\Exception(
'Calendar with id "' . $calendarId .
'" not found');
shareReply($href, $status, $calendarUri, $inReplyTo, $summary=null)
This method is called when a user replied to a request to share.
Adds support for sharing features to a CalDAV server.
getNotificationsForPrincipal($principalUri)
Returns a list of notifications for a given principal url.
deleteNotification($principalUri, NotificationInterface $notification)
This deletes a specific notifcation.
getCalendarsForUser($principalUri)
Returns a list of calendars for a principal.
This interface reflects a single notification type.
setPublishStatus($calendarId, $value)
Publishes a calendar.
updateInvites($calendarId, array $sharees)
Updates the list of shares.
__construct(array $calendars=[], array $calendarData=[], array $notifications=[])
Adds caldav notification support to a backend.
getInvites($calendarId)
Returns the list of people whom this calendar is shared with.