3 class Sabre_CalDAV_Backend_Friendica extends Sabre_CalDAV_Backend_Common
6 public function getNamespace() {
7 return CALDAV_NAMESPACE_FRIENDICA_NATIVE;
10 public function getCalUrlPrefix() {
16 * Creates a new calendar for a principal.
18 * If the creation was a success, an id must be returned that can be used to reference
19 * this calendar in other methods, such as updateCalendar.
21 * @param string $principalUri
22 * @param string $calendarUri
23 * @param array $properties
24 * @throws Sabre_DAV_Exception_Forbidden
27 function createCalendar($principalUri, $calendarUri, array $properties)
29 throw new Sabre_DAV_Exception_Forbidden();
33 * Delete a calendar and all it's objects
35 * @param string $calendarId
36 * @throws Sabre_DAV_Exception_Forbidden
39 function deleteCalendar($calendarId)
41 throw new Sabre_DAV_Exception_Forbidden();
45 * @param string $calendarId
48 function getCalendarObjects($calendarId)
51 $user_id = $a->user["uid"];
52 $x = explode("-", $calendarId);
55 $objs = FriendicaVirtualCalSourceBackend::getItemsByTime($user_id, $x[1]);
56 foreach ($objs as $obj) {
58 "id" => IntVal($obj["data_uri"]),
59 "calendardata" => $obj["ical"],
60 "uri" => $obj["data_uri"],
61 "lastmodified" => $obj["date"],
62 "calendarid" => $calendarId,
63 "etag" => $obj["ical_etag"],
64 "size" => IntVal($obj["ical_size"]),
72 * Returns information from a single calendar object, based on it's object
75 * The returned array must have the same keys as getCalendarObjects. The
76 * 'calendardata' object is required here though, while it's not required
77 * for getCalendarObjects.
79 * @param string $calendarId
80 * @param string $objectUri
81 * @throws Sabre_DAV_Exception_FileNotFound
84 function getCalendarObject($calendarId, $objectUri)
87 $user_id = $a->user["uid"];
88 $obj = FriendicaVirtualCalSourceBackend::getItemsByUri($user_id, $objectUri);
91 "id" => IntVal($obj["data_uri"]),
92 "calendardata" => $obj["ical"],
93 "uri" => $obj["data_uri"],
94 "lastmodified" => $obj["date"],
95 "calendarid" => $calendarId,
96 "etag" => $obj["ical_etag"],
97 "size" => IntVal($obj["ical_size"]),
102 * Creates a new calendar object.
104 * @param string $calendarId
105 * @param string $objectUri
106 * @param string $calendarData
107 * @throws Sabre_DAV_Exception_Forbidden
108 * @return null|string|void
110 function createCalendarObject($calendarId, $objectUri, $calendarData)
112 throw new Sabre_DAV_Exception_Forbidden();
116 * Updates an existing calendarobject, based on it's uri.
118 * @param string $calendarId
119 * @param string $objectUri
120 * @param string $calendarData
121 * @throws Sabre_DAV_Exception_Forbidden
122 * @return null|string|void
124 function updateCalendarObject($calendarId, $objectUri, $calendarData)
126 throw new Sabre_DAV_Exception_Forbidden();
130 * Deletes an existing calendar object.
132 * @param string $calendarId
133 * @param string $objectUri
134 * @throws Sabre_DAV_Exception_Forbidden
137 function deleteCalendarObject($calendarId, $objectUri)
139 throw new Sabre_DAV_Exception_Forbidden();