1<?php 2 3namespace Sabre\CalDAV\Backend; 4 5use Sabre\DAV; 6 7/** 8 * Every CalDAV backend must at least implement this interface. 9 * 10 * @copyright Copyright (C) 2007-2015 fruux GmbH (https://fruux.com/). 11 * @author Evert Pot (http://evertpot.com/) 12 * @license http://sabre.io/license/ Modified BSD License 13 */ 14interface SubscriptionSupport extends BackendInterface { 15 16 /** 17 * Returns a list of subscriptions for a principal. 18 * 19 * Every subscription is an array with the following keys: 20 * * id, a unique id that will be used by other functions to modify the 21 * subscription. This can be the same as the uri or a database key. 22 * * uri. This is just the 'base uri' or 'filename' of the subscription. 23 * * principaluri. The owner of the subscription. Almost always the same as 24 * principalUri passed to this method. 25 * 26 * Furthermore, all the subscription info must be returned too: 27 * 28 * 1. {DAV:}displayname 29 * 2. {http://apple.com/ns/ical/}refreshrate 30 * 3. {http://calendarserver.org/ns/}subscribed-strip-todos (omit if todos 31 * should not be stripped). 32 * 4. {http://calendarserver.org/ns/}subscribed-strip-alarms (omit if alarms 33 * should not be stripped). 34 * 5. {http://calendarserver.org/ns/}subscribed-strip-attachments (omit if 35 * attachments should not be stripped). 36 * 6. {http://calendarserver.org/ns/}source (Must be a 37 * Sabre\DAV\Property\Href). 38 * 7. {http://apple.com/ns/ical/}calendar-color 39 * 8. {http://apple.com/ns/ical/}calendar-order 40 * 9. {urn:ietf:params:xml:ns:caldav}supported-calendar-component-set 41 * (should just be an instance of 42 * Sabre\CalDAV\Property\SupportedCalendarComponentSet, with a bunch of 43 * default components). 44 * 45 * @param string $principalUri 46 * @return array 47 */ 48 function getSubscriptionsForUser($principalUri); 49 50 /** 51 * Creates a new subscription for a principal. 52 * 53 * If the creation was a success, an id must be returned that can be used to reference 54 * this subscription in other methods, such as updateSubscription. 55 * 56 * @param string $principalUri 57 * @param string $uri 58 * @param array $properties 59 * @return mixed 60 */ 61 function createSubscription($principalUri, $uri, array $properties); 62 63 /** 64 * Updates a subscription 65 * 66 * The list of mutations is stored in a Sabre\DAV\PropPatch object. 67 * To do the actual updates, you must tell this object which properties 68 * you're going to process with the handle() method. 69 * 70 * Calling the handle method is like telling the PropPatch object "I 71 * promise I can handle updating this property". 72 * 73 * Read the PropPatch documenation for more info and examples. 74 * 75 * @param mixed $subscriptionId 76 * @param \Sabre\DAV\PropPatch $propPatch 77 * @return void 78 */ 79 function updateSubscription($subscriptionId, DAV\PropPatch $propPatch); 80 81 /** 82 * Deletes a subscription. 83 * 84 * @param mixed $subscriptionId 85 * @return void 86 */ 87 function deleteSubscription($subscriptionId); 88 89} 90