14 use \Sabre\DAVACL\ACLTrait;
59 if (!isset($objectData[
'uri'])) {
60 throw new \InvalidArgumentException(
'The objectData argument must contain an \'uri\' property');
75 return $this->objectData[
'uri'];
88 if (!isset($this->objectData[
'calendardata'])) {
89 $this->objectData = $this->caldavBackend->getCalendarObject($this->calendarInfo[
'id'], $this->objectData[
'uri']);
91 return $this->objectData[
'calendardata'];
101 function put($calendarData) {
103 if (is_resource($calendarData)) {
104 $calendarData = stream_get_contents($calendarData);
106 $etag = $this->caldavBackend->updateCalendarObject($this->calendarInfo[
'id'], $this->objectData[
'uri'], $calendarData);
107 $this->objectData[
'calendardata'] = $calendarData;
108 $this->objectData[
'etag'] = $etag;
121 $this->caldavBackend->deleteCalendarObject($this->calendarInfo[
'id'], $this->objectData[
'uri']);
132 $mime =
'text/calendar; charset=utf-8';
133 if (isset($this->objectData[
'component']) && $this->objectData[
'component']) {
134 $mime .=
'; component=' . $this->objectData[
'component'];
149 if (isset($this->objectData[
'etag'])) {
150 return $this->objectData[
'etag'];
152 return '"' . md5($this->
get()) .
'"';
164 return $this->objectData[
'lastmodified'];
175 if (array_key_exists(
'size', $this->objectData)) {
176 return $this->objectData[
'size'];
178 return strlen($this->
get());
192 return $this->calendarInfo[
'principaluri'];
211 if (isset($this->objectData[
'acl'])) {
212 return $this->objectData[
'acl'];
218 'privilege' =>
'{DAV:}all',
219 'principal' => $this->calendarInfo[
'principaluri'],
223 'privilege' =>
'{DAV:}all',
224 'principal' => $this->calendarInfo[
'principaluri'] .
'/calendar-proxy-write',
228 'privilege' =>
'{DAV:}read',
229 'principal' => $this->calendarInfo[
'principaluri'] .
'/calendar-proxy-read',
getOwner()
Returns the owner principal.
getETag()
Returns an ETag for this object.
put($calendarData)
Updates the ICalendar-formatted object.
The CalendarObject represents a single VEVENT or VTODO within a Calendar.
getContentType()
Returns the mime content-type.
getACL()
Returns a list of ACE's for this node.
getLastModified()
Returns the last modification date as a unix timestamp.
getSize()
Returns the size of this object in bytes.
CalendarObject interface.
__construct(Backend\BackendInterface $caldavBackend, array $calendarInfo, array $objectData)
Constructor.
Implement this interface to create your own principal backends.
getName()
Returns the uri for this object.