57 return $this->calendarInfo[
'uri'];
75 return $this->caldavBackend->updateCalendar($this->calendarInfo[
'id'], $propPatch);
89 foreach ($this->calendarInfo as $propName => $propValue) {
91 if (!is_null($propValue) && $propName[0] ===
'{')
92 $response[$propName] = $this->calendarInfo[$propName];
109 $obj = $this->caldavBackend->getCalendarObject($this->calendarInfo[
'id'],
$name);
111 if (!$obj)
throw new DAV\Exception\NotFound(
'Calendar object not found');
115 return new CalendarObject($this->caldavBackend, $this->calendarInfo, $obj);
126 $objs = $this->caldavBackend->getCalendarObjects($this->calendarInfo[
'id']);
128 foreach ($objs as $obj) {
130 $children[] =
new CalendarObject($this->caldavBackend, $this->calendarInfo, $obj);
147 $objs = $this->caldavBackend->getMultipleCalendarObjects($this->calendarInfo[
'id'], $paths);
149 foreach ($objs as $obj) {
151 $children[] =
new CalendarObject($this->caldavBackend, $this->calendarInfo, $obj);
165 $obj = $this->caldavBackend->getCalendarObject($this->calendarInfo[
'id'],
$name);
183 throw new DAV\Exception\MethodNotAllowed(
'Creating collections in calendar objects is not allowed');
198 if (is_resource($calendarData)) {
199 $calendarData = stream_get_contents($calendarData);
201 return $this->caldavBackend->createCalendarObject($this->calendarInfo[
'id'],
$name, $calendarData);
212 $this->caldavBackend->deleteCalendar($this->calendarInfo[
'id']);
225 throw new DAV\Exception\MethodNotAllowed(
'Renaming calendars is not yet supported');
249 return $this->calendarInfo[
'principaluri'];
269 'privilege' =>
'{DAV:}read',
274 'privilege' =>
'{DAV:}read',
275 'principal' => $this->
getOwner() .
'/calendar-proxy-write',
279 'privilege' =>
'{DAV:}read',
280 'principal' => $this->
getOwner() .
'/calendar-proxy-read',
285 'principal' =>
'{DAV:}authenticated',
290 if (empty($this->calendarInfo[
'{http://sabredav.org/ns}read-only'])) {
292 'privilege' =>
'{DAV:}write',
297 'privilege' =>
'{DAV:}write',
298 'principal' => $this->
getOwner() .
'/calendar-proxy-write',
318 'privilege' =>
'{DAV:}read',
324 'privilege' =>
'{DAV:}read',
325 'principal' => $this->
getOwner() .
'/calendar-proxy-write',
329 'privilege' =>
'{DAV:}read',
330 'principal' => $this->
getOwner() .
'/calendar-proxy-read',
335 if (empty($this->calendarInfo[
'{http://sabredav.org/ns}read-only'])) {
337 'privilege' =>
'{DAV:}write',
342 'privilege' =>
'{DAV:}write',
343 'principal' => $this->
getOwner() .
'/calendar-proxy-write',
372 return $this->caldavBackend->calendarQuery($this->calendarInfo[
'id'], $filters);
388 $this->caldavBackend instanceof Backend\SyncSupport &&
389 isset($this->calendarInfo[
'{DAV:}sync-token'])
391 return $this->calendarInfo[
'{DAV:}sync-token'];
394 $this->caldavBackend instanceof Backend\SyncSupport &&
395 isset($this->calendarInfo[
'{http://sabredav.org/ns}sync-token'])
397 return $this->calendarInfo[
'{http://sabredav.org/ns}sync-token'];
459 if (!$this->caldavBackend instanceof Backend\SyncSupport) {
463 return $this->caldavBackend->getChangesForCalendar(
464 $this->calendarInfo[
'id'],
getACL()
Returns a list of ACE's for this node.
This class represents a set of properties that are going to be updated.
getLastModified()
Returns the last modification date as a unix timestamp.
getMultipleChildren(array $paths)
This method receives a list of paths in it's first argument.
setName($newName)
Renames the calendar.
getChildACL()
This method returns the ACL's for calendar objects in this calendar.
getOwner()
Returns the owner principal.
The CalendarObject represents a single VEVENT or VTODO within a Calendar.
propPatch(PropPatch $propPatch)
Updates properties on this node.
getName()
Returns the name of the calendar.
getChanges($syncToken, $syncLevel, $limit=null)
The getChanges method returns all the changes that have happened, since the specified syncToken and t...
childExists($name)
Checks if a child-node exists.
If a class extends ISyncCollection, it supports WebDAV-sync.
calendarQuery(array $filters)
Performs a calendar-query on the contents of this calendar.
createDirectory($name)
Creates a new directory.
createFile($name, $calendarData=null)
Creates a new file.
__construct(Backend\BackendInterface $caldavBackend, $calendarInfo)
Constructor.
This object represents a CalDAV calendar.
getChildren()
Returns the full list of calendar objects.
getChild($name)
Returns a calendar object.
Implement this interface to create your own principal backends.
const NS_CALDAV
This is the official CalDAV namespace.
getSyncToken()
This method returns the current sync-token for this collection.
getProperties($requestedProperties)
Returns the list of properties.