ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\CalDAV\Schedule\Inbox Class Reference

The CalDAV scheduling inbox. More...

+ Inheritance diagram for Sabre\CalDAV\Schedule\Inbox:
+ Collaboration diagram for Sabre\CalDAV\Schedule\Inbox:

Public Member Functions

 __construct (Backend\SchedulingSupport $caldavBackend, $principalUri)
 Constructor. More...
 
 getName ()
 Returns the name of the node. More...
 
 getChildren ()
 Returns an array with all the child nodes. More...
 
 createFile ($name, $data=null)
 Creates a new file in the directory. More...
 
 getOwner ()
 Returns the owner principal. More...
 
 getACL ()
 Returns a list of ACE's for this node. More...
 
 calendarQuery (array $filters)
 Performs a calendar-query on the contents of this calendar. More...
 
- Public Member Functions inherited from Sabre\DAV\Collection
 getChild ($name)
 Returns a child object, by its name. More...
 
 childExists ($name)
 Checks is a child-node exists. More...
 
 createFile ($name, $data=null)
 Creates a new file in the directory. More...
 
 createDirectory ($name)
 Creates a new subdirectory. More...
 
- Public Member Functions inherited from Sabre\DAV\Node
 getLastModified ()
 Returns the last modification time as a unix timestamp. More...
 
 delete ()
 Deletes the current node. More...
 
 setName ($name)
 Renames the node. More...
 
 delete ()
 Deleted the current node. More...
 
 getName ()
 Returns the name of the node. More...
 
 setName ($name)
 Renames the node. More...
 
 getLastModified ()
 Returns the last modification time, as a unix timestamp. More...
 
 createFile ($name, $data=null)
 Creates a new file in the directory. More...
 
 createDirectory ($name)
 Creates a new subdirectory. More...
 
 getChild ($name)
 Returns a specific child node, referenced by its name. More...
 
 getChildren ()
 Returns an array with all the child nodes. More...
 
 childExists ($name)
 Checks if a child-node with the specified name exists. More...
 
 calendarQuery (array $filters)
 Performs a calendar-query on the contents of this calendar. More...
 
- Public Member Functions inherited from Sabre\DAVACL\IACL
 getOwner ()
 Returns the owner principal. More...
 
 getGroup ()
 Returns a group principal. More...
 
 getACL ()
 Returns a list of ACE's for this node. More...
 
 setACL (array $acl)
 Updates the ACL. More...
 
 getSupportedPrivilegeSet ()
 Returns the list of supported privileges for this node. More...
 

Protected Attributes

 $caldavBackend
 
 $principalUri
 

Detailed Description

The CalDAV scheduling inbox.

Author
Evert Pot (http://evertpot.com/) @license http://sabre.io/license/ Modified BSD License

Definition at line 18 of file Inbox.php.

Constructor & Destructor Documentation

◆ __construct()

Sabre\CalDAV\Schedule\Inbox::__construct ( Backend\SchedulingSupport  $caldavBackend,
  $principalUri 
)

Constructor.

Parameters
Backend\SchedulingSupport$caldavBackend
string$principalUri

Definition at line 42 of file Inbox.php.

42 {
43
44 $this->caldavBackend = $caldavBackend;
45 $this->principalUri = $principalUri;
46
47 }

References Sabre\CalDAV\Schedule\Inbox\$caldavBackend, and Sabre\CalDAV\Schedule\Inbox\$principalUri.

Member Function Documentation

◆ calendarQuery()

Sabre\CalDAV\Schedule\Inbox::calendarQuery ( array  $filters)

Performs a calendar-query on the contents of this calendar.

The calendar-query is defined in RFC4791 : CalDAV. Using the calendar-query it is possible for a client to request a specific set of object, based on contents of iCalendar properties, date-ranges and iCalendar component types (VTODO, VEVENT).

This method should just return a list of (relative) urls that match this query.

The list of filters are specified as an array. The exact array is documented by \Sabre\CalDAV\CalendarQueryParser.

Parameters
array$filters
Returns
array

Implements Sabre\CalDAV\ICalendarObjectContainer.

Definition at line 184 of file Inbox.php.

184 {
185
186 $result = [];
187 $validator = new CalDAV\CalendarQueryValidator();
188
189 $objects = $this->caldavBackend->getSchedulingObjects($this->principalUri);
190 foreach ($objects as $object) {
191 $vObject = VObject\Reader::read($object['calendardata']);
192 if ($validator->validate($vObject, $filters)) {
193 $result[] = $object['uri'];
194 }
195
196 // Destroy circular references to PHP will GC the object.
197 $vObject->destroy();
198 }
199 return $result;
200
201 }
$result
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
Definition: Reader.php:42

References $result, and Sabre\VObject\Reader\read().

+ Here is the call graph for this function:

◆ createFile()

Sabre\CalDAV\Schedule\Inbox::createFile (   $name,
  $data = null 
)

Creates a new file in the directory.

Data will either be supplied as a stream resource, or in certain cases as a string. Keep in mind that you may have to support either.

After successful creation of the file, you may choose to return the ETag of the new file here.

The returned ETag must be surrounded by double-quotes (The quotes should be part of the actual string).

If you cannot accurately determine the ETag, you should not return it. If you don't store the file exactly as-is (you're transforming it somehow) you should also not return an ETag.

This means that if a subsequent GET to this new file does not exactly return the same contents of what was submitted here, you are strongly recommended to omit the ETag.

Parameters
string$nameName of the file
resource | string$dataInitial payload
Returns
null|string

Reimplemented from Sabre\DAV\Collection.

Definition at line 104 of file Inbox.php.

104 {
105
106 $this->caldavBackend->createSchedulingObject($this->principalUri, $name, $data);
107
108 }
$data
Definition: bench.php:6

References $data, and $name.

◆ getACL()

Sabre\CalDAV\Schedule\Inbox::getACL ( )

Returns a list of ACE's for this node.

Each ACE has the following properties:

  • 'privilege', a string such as {DAV:}read or {DAV:}write. These are currently the only supported privileges
  • 'principal', a url to the principal who owns the node
  • 'protected' (optional), indicating that this ACE is not allowed to be updated.
Returns
array

Implements Sabre\DAVACL\IACL.

Definition at line 135 of file Inbox.php.

135 {
136
137 return [
138 [
139 'privilege' => '{DAV:}read',
140 'principal' => '{DAV:}authenticated',
141 'protected' => true,
142 ],
143 [
144 'privilege' => '{DAV:}write-properties',
145 'principal' => $this->getOwner(),
146 'protected' => true,
147 ],
148 [
149 'privilege' => '{DAV:}unbind',
150 'principal' => $this->getOwner(),
151 'protected' => true,
152 ],
153 [
154 'privilege' => '{DAV:}unbind',
155 'principal' => $this->getOwner() . '/calendar-proxy-write',
156 'protected' => true,
157 ],
158 [
159 'privilege' => '{' . CalDAV\Plugin::NS_CALDAV . '}schedule-deliver',
160 'principal' => '{DAV:}authenticated',
161 'protected' => true,
162 ],
163 ];
164
165 }
const NS_CALDAV
This is the official CalDAV namespace.
Definition: Plugin.php:33
getOwner()
Returns the owner principal.
Definition: Inbox.php:117

References Sabre\CalDAV\Schedule\Inbox\getOwner(), and Sabre\CalDAV\Plugin\NS_CALDAV.

+ Here is the call graph for this function:

◆ getChildren()

Sabre\CalDAV\Schedule\Inbox::getChildren ( )

Returns an array with all the child nodes.

Returns
\Sabre\DAV\INode[]

Implements Sabre\DAV\ICollection.

Definition at line 67 of file Inbox.php.

67 {
68
69 $objs = $this->caldavBackend->getSchedulingObjects($this->principalUri);
70 $children = [];
71 foreach ($objs as $obj) {
72 //$obj['acl'] = $this->getACL();
73 $obj['principaluri'] = $this->principalUri;
74 $children[] = new SchedulingObject($this->caldavBackend, $obj);
75 }
76 return $children;
77
78 }

References Sabre\CalDAV\Schedule\Inbox\$principalUri.

◆ getName()

Sabre\CalDAV\Schedule\Inbox::getName ( )

Returns the name of the node.

This is used to generate the url.

Returns
string

Implements Sabre\DAV\INode.

Definition at line 56 of file Inbox.php.

56 {
57
58 return 'inbox';
59
60 }

◆ getOwner()

Sabre\CalDAV\Schedule\Inbox::getOwner ( )

Returns the owner principal.

This must be a url to a principal, or null if there's no owner

Returns
string|null

Implements Sabre\DAVACL\IACL.

Definition at line 117 of file Inbox.php.

117 {
118
119 return $this->principalUri;
120
121 }

References Sabre\CalDAV\Schedule\Inbox\$principalUri.

Referenced by Sabre\CalDAV\Schedule\Inbox\getACL().

+ Here is the caller graph for this function:

Field Documentation

◆ $caldavBackend

Sabre\CalDAV\Schedule\Inbox::$caldavBackend
protected

Definition at line 27 of file Inbox.php.

Referenced by Sabre\CalDAV\Schedule\Inbox\__construct().

◆ $principalUri

Sabre\CalDAV\Schedule\Inbox::$principalUri
protected

The documentation for this class was generated from the following file: