4 abstract class AnimexxCalSource
8 * @var int $namespace_id
10 protected $namespace_id;
13 * @var DBClass_friendica_calendars $calendarDb
15 protected $calendarDb;
25 * @param int $namespace_id
26 * @throws Sabre_DAV_Exception_NotFound
28 function __construct($user_id = 0, $namespace_id = 0)
30 $this->namespace_id = IntVal($namespace_id);
31 $this->user_id = IntVal($user_id);
33 $x = q("SELECT * FROM %s%scalendars WHERE `namespace` = %d AND `namespace_id` = %d AND `uid` = %d",
34 CALDAV_SQL_DB, CALDAV_SQL_PREFIX, $this->getNamespace(), $this->namespace_id, $this->user_id
37 if (count($x) != 1) throw new Sabre_DAV_Exception_NotFound("Not found");
40 $this->calendarDb = new DBClass_friendica_calendars($x[0]);
41 } catch (Exception $e) {
42 throw new Sabre_DAV_Exception_NotFound("Not found");
50 public static abstract function getNamespace();
57 public abstract function getPermissionsCalendar($user);
62 * @param string $item_uri
63 * @param string $recurrence_uri
64 * @param array|null $item_arr
67 public abstract function getPermissionsItem($user, $item_uri, $recurrence_uri, $item_arr = null);
73 * @param string $subject
75 * @param string $description
76 * @param string $location
78 * @param string $timezone
79 * @param bool $notification
80 * @param null $notification_type
81 * @param null $notification_value
83 public abstract function updateItem($uri, $start, $end, $subject = "", $allday = false, $description = "", $location = "", $color = null,
84 $timezone = "", $notification = true, $notification_type = null, $notification_value = null);
91 * @param string $subject
93 * @param string $description
94 * @param string $location
96 * @param string $timezone
97 * @param bool $notification
98 * @param null $notification_type
99 * @param null $notification_value
102 public abstract function addItem($start, $end, $subject, $allday = false, $description = "", $location = "", $color = null,
103 $timezone = "", $notification = true, $notification_type = null, $notification_value = null);
109 public abstract function removeItem($uri);
116 * @param string $base_path
119 public abstract function listItemsByRange($sd, $ed, $base_path);
127 public abstract function getItemByUri($uri);
132 * @return null|string
134 public function getItemDetailRedirect($uri) {