ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
SchedulingObject.php
Go to the documentation of this file.
1<?php
2
4
7
16
22 protected $caldavBackend;
23
29 protected $objectData;
30
49
50 $this->caldavBackend = $caldavBackend;
51
52 if (!isset($objectData['uri'])) {
53 throw new \InvalidArgumentException('The objectData argument must contain an \'uri\' property');
54 }
55
56 $this->objectData = $objectData;
57
58 }
59
65 function get() {
66
67 // Pre-populating the 'calendardata' is optional, if we don't have it
68 // already we fetch it from the backend.
69 if (!isset($this->objectData['calendardata'])) {
70 $this->objectData = $this->caldavBackend->getSchedulingObject($this->objectData['principaluri'], $this->objectData['uri']);
71 }
72 return $this->objectData['calendardata'];
73
74 }
75
82 function put($calendarData) {
83
84 throw new MethodNotAllowed('Updating scheduling objects is not supported');
85
86 }
87
93 function delete() {
94
95 $this->caldavBackend->deleteSchedulingObject($this->objectData['principaluri'], $this->objectData['uri']);
96
97 }
98
106 function getOwner() {
107
108 return $this->objectData['principaluri'];
109
110 }
111
112
125 function getACL() {
126
127 // An alternative acl may be specified in the object data.
128 //
129
130 if (isset($this->objectData['acl'])) {
131 return $this->objectData['acl'];
132 }
133
134 // The default ACL
135 return [
136 [
137 'privilege' => '{DAV:}all',
138 'principal' => '{DAV:}owner',
139 'protected' => true,
140 ],
141 [
142 'privilege' => '{DAV:}all',
143 'principal' => $this->objectData['principaluri'] . '/calendar-proxy-write',
144 'protected' => true,
145 ],
146 [
147 'privilege' => '{DAV:}read',
148 'principal' => $this->objectData['principaluri'] . '/calendar-proxy-read',
149 'protected' => true,
150 ],
151 ];
152
153 }
154
155}
An exception for terminatinating execution or to throw for unit testing.
The CalendarObject represents a single VEVENT or VTODO within a Calendar.
The SchedulingObject represents a scheduling object in the Inbox collection.
getOwner()
Returns the owner principal.
getACL()
Returns a list of ACE's for this node.
put($calendarData)
Updates the ICalendar-formatted object.
__construct(Backend\SchedulingSupport $caldavBackend, array $objectData)
Constructor.
Implementing this interface adds CalDAV Scheduling support to your caldav server, as defined in rfc66...
The SchedulingObject represents a scheduling object in the Inbox collection.