ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Public Member Functions | |
__construct (\PDO $pdo) | |
Creates the backend. More... | |
getCalendarsForUser ($principalUri) | |
Returns a list of calendars for a principal. More... | |
createCalendar ($principalUri, $calendarUri, array $properties) | |
Creates a new calendar for a principal. More... | |
updateCalendar ($calendarId, \Sabre\DAV\PropPatch $propPatch) | |
Updates properties for a calendar. More... | |
deleteCalendar ($calendarId) | |
Delete a calendar and all it's objects. More... | |
getCalendarObjects ($calendarId) | |
Returns all calendar objects within a calendar. More... | |
getCalendarObject ($calendarId, $objectUri) | |
Returns information from a single calendar object, based on it's object uri. More... | |
getMultipleCalendarObjects ($calendarId, array $uris) | |
Returns a list of calendar objects. More... | |
createCalendarObject ($calendarId, $objectUri, $calendarData) | |
Creates a new calendar object. More... | |
updateCalendarObject ($calendarId, $objectUri, $calendarData) | |
Updates an existing calendarobject, based on it's uri. More... | |
deleteCalendarObject ($calendarId, $objectUri) | |
Deletes an existing calendar object. More... | |
calendarQuery ($calendarId, array $filters) | |
Performs a calendar-query on the contents of this calendar. More... | |
getCalendarObjectByUID ($principalUri, $uid) | |
Searches through all of a users calendars and calendar objects to find an object with a specific UID. More... | |
getChangesForCalendar ($calendarId, $syncToken, $syncLevel, $limit=null) | |
The getChanges method returns all the changes that have happened, since the specified syncToken in the specified calendar. More... | |
getSubscriptionsForUser ($principalUri) | |
Returns a list of subscriptions for a principal. More... | |
createSubscription ($principalUri, $uri, array $properties) | |
Creates a new subscription for a principal. More... | |
updateSubscription ($subscriptionId, DAV\PropPatch $propPatch) | |
Updates a subscription. More... | |
deleteSubscription ($subscriptionId) | |
Deletes a subscription. More... | |
getSchedulingObject ($principalUri, $objectUri) | |
Returns a single scheduling object. More... | |
getSchedulingObjects ($principalUri) | |
Returns all scheduling objects for the inbox collection. More... | |
deleteSchedulingObject ($principalUri, $objectUri) | |
Deletes a scheduling object. More... | |
createSchedulingObject ($principalUri, $objectUri, $objectData) | |
Creates a new scheduling object. More... | |
updateInvites ($calendarId, array $sharees) | |
Updates the list of shares. More... | |
getInvites ($calendarId) | |
Returns the list of people whom a calendar is shared with. More... | |
setPublishStatus ($calendarId, $value) | |
Publishes a calendar. More... | |
Public Member Functions inherited from Sabre\CalDAV\Backend\AbstractBackend | |
updateCalendar ($calendarId, \Sabre\DAV\PropPatch $propPatch) | |
Updates properties for a calendar. More... | |
getMultipleCalendarObjects ($calendarId, array $uris) | |
Returns a list of calendar objects. More... | |
calendarQuery ($calendarId, array $filters) | |
Performs a calendar-query on the contents of this calendar. More... | |
getCalendarObjectByUID ($principalUri, $uid) | |
Searches through all of a users calendars and calendar objects to find an object with a specific UID. More... | |
Data Fields | |
const | MAX_DATE = '2038-01-01' |
We need to specify a max date, because we need to stop somewhere More... | |
$calendarTableName = 'calendars' | |
$calendarInstancesTableName = 'calendarinstances' | |
$calendarObjectTableName = 'calendarobjects' | |
$calendarChangesTableName = 'calendarchanges' | |
$schedulingObjectTableName = 'schedulingobjects' | |
$calendarSubscriptionsTableName = 'calendarsubscriptions' | |
$propertyMap | |
$subscriptionPropertyMap | |
Protected Member Functions | |
getDenormalizedData ($calendarData) | |
Parses some information from calendar objects, used for optimized calendar-queries. More... | |
addChange ($calendarId, $objectUri, $operation) | |
Adds a change record to the calendarchanges table. More... | |
Protected Member Functions inherited from Sabre\CalDAV\Backend\AbstractBackend | |
validateFilterForObject (array $object, array $filters) | |
This method validates if a filter (as passed to calendarQuery) matches the given object. More... | |
Protected Attributes | |
$pdo | |
This backend is used to store calendar-data in a PDO database, such as sqlite or MySQL
Sabre\CalDAV\Backend\PDO::__construct | ( | \PDO | $pdo | ) |
Creates the backend.
\PDO | $pdo |
Definition at line 126 of file PDO.php.
References Sabre\CalDAV\Backend\PDO\$pdo.
|
protected |
Adds a change record to the calendarchanges table.
mixed | $calendarId | |
string | $objectUri | |
int | $operation | 1 = add, 2 = modify, 3 = delete. |
Definition at line 1040 of file PDO.php.
References $stmt.
Referenced by Sabre\CalDAV\Backend\PDO\createCalendarObject(), Sabre\CalDAV\Backend\PDO\deleteCalendarObject(), Sabre\CalDAV\Backend\PDO\updateCalendar(), and Sabre\CalDAV\Backend\PDO\updateCalendarObject().
Sabre\CalDAV\Backend\PDO::calendarQuery | ( | $calendarId, | |
array | $filters | ||
) |
Performs a calendar-query on the contents of this calendar.
The calendar-query is defined in RFC4791 : CalDAV. Using the calendar-query it is possible for a client to request a specific set of object, based on contents of iCalendar properties, date-ranges and iCalendar component types (VTODO, VEVENT).
This method should just return a list of (relative) urls that match this query.
The list of filters are specified as an array. The exact array is documented by .
Note that it is extremely likely that getCalendarObject for every path returned from this method will be called almost immediately after. You may want to anticipate this to speed up these requests.
This method provides a default implementation, which parses all the iCalendar objects in the specified calendar.
This default may well be good enough for personal use, and calendars that aren't very large. But if you anticipate high usage, big calendars or high loads, you are strongly adviced to optimize certain paths.
The best way to do so is override this method and to optimize specifically for 'common filters'.
Requests that are extremely common are:
..and combinations of these requests. It may not be worth it to try to handle every possible situation and just rely on the (relatively easy to use) CalendarQueryValidator to handle the rest.
Note that especially time-range-filters may be difficult to parse. A time-range filter specified on a VEVENT must for instance also handle recurrence rules correctly. A good example of how to interpret all these filters can also simply be found in . This class is as correct as possible, so it gives you a good idea on what type of stuff you need to think of.
This specific implementation (for the PDO) backend optimizes filters on specific components, and VEVENT time-ranges.
mixed | $calendarId | |
array | $filters |
Implements Sabre\CalDAV\Backend\BackendInterface.
Definition at line 786 of file PDO.php.
References $query, $result, $row, $stmt, $values, and Sabre\CalDAV\Backend\AbstractBackend\validateFilterForObject().
Sabre\CalDAV\Backend\PDO::createCalendar | ( | $principalUri, | |
$calendarUri, | |||
array | $properties | ||
) |
Creates a new calendar for a principal.
If the creation was a success, an id must be returned that can be used to reference this calendar in other methods, such as updateCalendar.
string | $principalUri | |
string | $calendarUri | |
array | $properties |
Implements Sabre\CalDAV\Backend\BackendInterface.
Definition at line 232 of file PDO.php.
References $stmt, $values, and Sabre\CalDAV\Plugin\NS_CALDAV.
Sabre\CalDAV\Backend\PDO::createCalendarObject | ( | $calendarId, | |
$objectUri, | |||
$calendarData | |||
) |
Creates a new calendar object.
The object uri is only the basename, or filename and not a full path.
It is possible return an etag from this function, which will be used in the response to this PUT request. Note that the ETag must be surrounded by double-quotes.
However, you should only really return this ETag if you don't mangle the calendar-data. If the result of a subsequent GET to this object is not the exact same as this request body, you should omit the ETag.
mixed | $calendarId | |
string | $objectUri | |
string | $calendarData |
Implements Sabre\CalDAV\Backend\BackendInterface.
Definition at line 561 of file PDO.php.
References $stmt, Sabre\CalDAV\Backend\PDO\addChange(), and Sabre\CalDAV\Backend\PDO\getDenormalizedData().
Sabre\CalDAV\Backend\PDO::createSchedulingObject | ( | $principalUri, | |
$objectUri, | |||
$objectData | |||
) |
Creates a new scheduling object.
This should land in a users' inbox.
string | $principalUri | |
string | $objectUri | |
string | $objectData |
Implements Sabre\CalDAV\Backend\SchedulingSupport.
Definition at line 1329 of file PDO.php.
References $stmt.
Sabre\CalDAV\Backend\PDO::createSubscription | ( | $principalUri, | |
$uri, | |||
array | $properties | ||
) |
Creates a new subscription for a principal.
If the creation was a success, an id must be returned that can be used to reference this subscription in other methods, such as updateSubscription.
string | $principalUri | |
string | $uri | |
array | $properties |
Implements Sabre\CalDAV\Backend\SubscriptionSupport.
Definition at line 1139 of file PDO.php.
References $stmt, and $values.
Sabre\CalDAV\Backend\PDO::deleteCalendar | ( | $calendarId | ) |
Delete a calendar and all it's objects.
mixed | $calendarId |
If the user is the owner of the calendar, we delete all data and all instances.
If it was an instance of a shared calendar, we only delete that instance.
Implements Sabre\CalDAV\Backend\BackendInterface.
Definition at line 354 of file PDO.php.
References $stmt.
Sabre\CalDAV\Backend\PDO::deleteCalendarObject | ( | $calendarId, | |
$objectUri | |||
) |
Deletes an existing calendar object.
The object uri is only the basename, or filename and not a full path.
mixed | $calendarId | |
string | $objectUri |
Implements Sabre\CalDAV\Backend\BackendInterface.
Definition at line 720 of file PDO.php.
References $stmt, and Sabre\CalDAV\Backend\PDO\addChange().
Sabre\CalDAV\Backend\PDO::deleteSchedulingObject | ( | $principalUri, | |
$objectUri | |||
) |
Deletes a scheduling object.
string | $principalUri | |
string | $objectUri |
Implements Sabre\CalDAV\Backend\SchedulingSupport.
Definition at line 1314 of file PDO.php.
References $stmt.
Sabre\CalDAV\Backend\PDO::deleteSubscription | ( | $subscriptionId | ) |
Deletes a subscription.
mixed | $subscriptionId |
Implements Sabre\CalDAV\Backend\SubscriptionSupport.
Definition at line 1235 of file PDO.php.
References $stmt.
Sabre\CalDAV\Backend\PDO::getCalendarObject | ( | $calendarId, | |
$objectUri | |||
) |
Returns information from a single calendar object, based on it's object uri.
The object uri is only the basename, or filename and not a full path.
The returned array must have the same keys as getCalendarObjects. The 'calendardata' object is required here though, while it's not required for getCalendarObjects.
This method must return null if the object did not exist.
mixed | $calendarId | |
string | $objectUri |
Implements Sabre\CalDAV\Backend\BackendInterface.
Definition at line 470 of file PDO.php.
Sabre\CalDAV\Backend\PDO::getCalendarObjectByUID | ( | $principalUri, | |
$uid | |||
) |
Searches through all of a users calendars and calendar objects to find an object with a specific UID.
This method should return the path to this object, relative to the calendar home, so this path usually only contains two parts:
calendarpath/objectpath.ics
If the uid is not found, return null.
This method should only consider * objects that the principal owns, so any calendars owned by other principals that also appear in this collection should be ignored.
string | $principalUri | |
string | $uid |
Implements Sabre\CalDAV\Backend\BackendInterface.
Definition at line 884 of file PDO.php.
References $query, $row, and $stmt.
Sabre\CalDAV\Backend\PDO::getCalendarObjects | ( | $calendarId | ) |
Returns all calendar objects within a calendar.
Every item contains an array with the following keys:
Note that the etag is optional, but it's highly encouraged to return for speed reasons.
The calendardata is also optional. If it's not returned 'getCalendarObject' will be called later, which is expected to return calendardata.
If neither etag or size are specified, the calendardata will be used/fetched to determine these numbers. If both are specified the amount of times this is needed is reduced by a great degree.
mixed | $calendarId |
Implements Sabre\CalDAV\Backend\BackendInterface.
Definition at line 428 of file PDO.php.
References $result, $row, and $stmt.
Sabre\CalDAV\Backend\PDO::getCalendarsForUser | ( | $principalUri | ) |
Returns a list of calendars for a principal.
Every project is an array with the following keys:
Furthermore it can contain webdav properties in clark notation. A very common one is '{DAV:}displayname'.
Many clients also require: {urn:ietf:params:xml:ns:caldav}supported-calendar-component-set For this property, you can just return an instance of Sabre.
If you return {http://sabredav.org/ns}read-only and set the value to 1, ACL will automatically be put in read-only mode.
string | $principalUri |
Implements Sabre\CalDAV\Backend\BackendInterface.
Definition at line 156 of file PDO.php.
References $calendar, $row, $stmt, Sabre\CalDAV\Plugin\NS_CALDAV, and Sabre\CalDAV\Plugin\NS_CALENDARSERVER.
Sabre\CalDAV\Backend\PDO::getChangesForCalendar | ( | $calendarId, | |
$syncToken, | |||
$syncLevel, | |||
$limit = null |
|||
) |
The getChanges method returns all the changes that have happened, since the specified syncToken in the specified calendar.
This function should return an array, such as the following:
[ 'syncToken' => 'The current synctoken', 'added' => [ 'new.txt', ], 'modified' => [ 'modified.txt', ], 'deleted' => [ 'foo.php.bak', 'old.txt' ] ];
The returned syncToken property should reflect the current syncToken of the calendar, as reported in the {http://sabredav.org/ns}sync-token property this is needed here too, to ensure the operation is atomic.
If the $syncToken argument is specified as null, this is an initial sync, and all members should be reported.
The modified property is an array of nodenames that have changed since the last token.
The deleted property is an array with nodenames, that have been deleted from collection.
The $syncLevel argument is basically the 'depth' of the report. If it's 1, you only have to report changes that happened only directly in immediate descendants. If it's 2, it should also include changes from the nodes below the child collections. (grandchildren)
The $limit argument allows a client to specify how many results should be returned at most. If the limit is not specified, it should be treated as infinite.
If the limit (infinite or not) is higher than you're willing to return, you should throw a Sabre() exception.
If the syncToken is expired (due to data cleanup) or unknown, you must return null.
The limit is 'suggestive'. You are free to ignore it.
mixed | $calendarId | |
string | $syncToken | |
int | $syncLevel | |
int | $limit |
Implements Sabre\CalDAV\Backend\SyncSupport.
Definition at line 965 of file PDO.php.
References $query, $result, $row, and $stmt.
|
protected |
Parses some information from calendar objects, used for optimized calendar-queries.
Returns an array with the following keys:
string | $calendarData |
Definition at line 640 of file PDO.php.
References $end, Sabre\VObject\DateTimeParser\parse(), and Sabre\VObject\Reader\read().
Referenced by Sabre\CalDAV\Backend\PDO\createCalendarObject(), and Sabre\CalDAV\Backend\PDO\updateCalendarObject().
Sabre\CalDAV\Backend\PDO::getInvites | ( | $calendarId | ) |
Returns the list of people whom a calendar is shared with.
Every item in the returned list must be a Sharee object with at least the following properties set: $href $shareAccess $inviteStatus
and optionally: $properties
mixed | $calendarId |
Everyone is always immediately accepted, for now.
Implements Sabre\CalDAV\Backend\SharingSupport.
Definition at line 1456 of file PDO.php.
References $query, $result, $row, $stmt, and Sabre\HTTP\encodePath().
Referenced by Sabre\CalDAV\Backend\PDO\updateInvites().
Sabre\CalDAV\Backend\PDO::getMultipleCalendarObjects | ( | $calendarId, | |
array | $uris | ||
) |
Returns a list of calendar objects.
This method should work identical to getCalendarObject, but instead return all the calendar objects in the list as an array.
If the backend supports this, it may allow for some speed-ups.
mixed | $calendarId | |
array | $uris |
Implements Sabre\CalDAV\Backend\BackendInterface.
Definition at line 507 of file PDO.php.
References $query, $result, $row, and $stmt.
Sabre\CalDAV\Backend\PDO::getSchedulingObject | ( | $principalUri, | |
$objectUri | |||
) |
Returns a single scheduling object.
The returned array should contain the following elements:
string | $principalUri | |
string | $objectUri |
Implements Sabre\CalDAV\Backend\SchedulingSupport.
Definition at line 1258 of file PDO.php.
Sabre\CalDAV\Backend\PDO::getSchedulingObjects | ( | $principalUri | ) |
Returns all scheduling objects for the inbox collection.
These objects should be returned as an array. Every item in the array should follow the same structure as returned from getSchedulingObject.
The main difference is that 'calendardata' is optional.
string | $principalUri |
Implements Sabre\CalDAV\Backend\SchedulingSupport.
Definition at line 1287 of file PDO.php.
References $result, $row, and $stmt.
Sabre\CalDAV\Backend\PDO::getSubscriptionsForUser | ( | $principalUri | ) |
Returns a list of subscriptions for a principal.
Every subscription is an array with the following keys:
Furthermore, all the subscription info must be returned too:
string | $principalUri |
Implements Sabre\CalDAV\Backend\SubscriptionSupport.
Definition at line 1087 of file PDO.php.
References $row, $stmt, and Sabre\CalDAV\Plugin\NS_CALDAV.
Sabre\CalDAV\Backend\PDO::setPublishStatus | ( | $calendarId, | |
$value | |||
) |
Publishes a calendar.
mixed | $calendarId | |
bool | $value |
Implements Sabre\CalDAV\Backend\SharingSupport.
Sabre\CalDAV\Backend\PDO::updateCalendar | ( | $calendarId, | |
\Sabre\DAV\PropPatch | $propPatch | ||
) |
Updates properties for a calendar.
The list of mutations is stored in a Sabre object. To do the actual updates, you must tell this object which properties you're going to process with the handle() method.
Calling the handle method is like telling the PropPatch object "I promise I can handle updating this property".
Read the PropPatch documentation for more info and examples.
mixed | $calendarId | |
\Sabre\DAV\PropPatch | $propPatch |
Implements Sabre\CalDAV\Backend\BackendInterface.
Definition at line 305 of file PDO.php.
References $stmt, Sabre\CalDAV\Backend\PDO\addChange(), and Sabre\CalDAV\Plugin\NS_CALDAV.
Sabre\CalDAV\Backend\PDO::updateCalendarObject | ( | $calendarId, | |
$objectUri, | |||
$calendarData | |||
) |
Updates an existing calendarobject, based on it's uri.
The object uri is only the basename, or filename and not a full path.
It is possible return an etag from this function, which will be used in the response to this PUT request. Note that the ETag must be surrounded by double-quotes.
However, you should only really return this ETag if you don't mangle the calendar-data. If the result of a subsequent GET to this object is not the exact same as this request body, you should omit the ETag.
mixed | $calendarId | |
string | $objectUri | |
string | $calendarData |
Implements Sabre\CalDAV\Backend\BackendInterface.
Definition at line 607 of file PDO.php.
References $stmt, Sabre\CalDAV\Backend\PDO\addChange(), and Sabre\CalDAV\Backend\PDO\getDenormalizedData().
Sabre\CalDAV\Backend\PDO::updateInvites | ( | $calendarId, | |
array | $sharees | ||
) |
Updates the list of shares.
mixed | $calendarId | |
Implements Sabre\CalDAV\Backend\SharingSupport.
Definition at line 1343 of file PDO.php.
References Sabre\CalDAV\Backend\PDO\getInvites(), Sabre\DAV\UUIDUtil\getUUID(), Sabre\DAV\Sharing\Plugin\INVITE_ACCEPTED, and Sabre\DAV\Sharing\Plugin\INVITE_INVALID.
Sabre\CalDAV\Backend\PDO::updateSubscription | ( | $subscriptionId, | |
DAV\PropPatch | $propPatch | ||
) |
Updates a subscription.
The list of mutations is stored in a Sabre object. To do the actual updates, you must tell this object which properties you're going to process with the handle() method.
Calling the handle method is like telling the PropPatch object "I promise I can handle updating this property".
Read the PropPatch documentation for more info and examples.
mixed | $subscriptionId | |
\Sabre\DAV\PropPatch | $propPatch |
Implements Sabre\CalDAV\Backend\SubscriptionSupport.
Definition at line 1192 of file PDO.php.
References $stmt.
Sabre\CalDAV\Backend\PDO::$calendarChangesTableName = 'calendarchanges' |
Sabre\CalDAV\Backend\PDO::$calendarInstancesTableName = 'calendarinstances' |
Sabre\CalDAV\Backend\PDO::$calendarObjectTableName = 'calendarobjects' |
Sabre\CalDAV\Backend\PDO::$calendarSubscriptionsTableName = 'calendarsubscriptions' |
|
protected |
Definition at line 43 of file PDO.php.
Referenced by Sabre\CalDAV\Backend\PDO\__construct().
Sabre\CalDAV\Backend\PDO::$propertyMap |
Sabre\CalDAV\Backend\PDO::$schedulingObjectTableName = 'schedulingobjects' |
Sabre\CalDAV\Backend\PDO::$subscriptionPropertyMap |
const Sabre\CalDAV\Backend\PDO::MAX_DATE = '2038-01-01' |
We need to specify a max date, because we need to stop somewhere
On 32 bit system the maximum for a signed integer is 2147483647, so MAX_DATE cannot be higher than date('Y-m-d', 2147483647) which results in 2038-01-19 to avoid problems when the date is converted to a unix timestamp.
Definition at line 36 of file PDO.php.
Referenced by Sabre\CalDAV\Backend\AbstractPDOTest\testCreateCalendarObjectInfiniteRecurrence().