ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Collection.php
Go to the documentation of this file.
1 <?php
2 
4 
5 use Sabre\CalDAV;
6 use Sabre\DAV;
7 use Sabre\DAVACL;
8 
23 class Collection extends DAV\Collection implements ICollection, DAVACL\IACL {
24 
25  use DAVACL\ACLTrait;
26 
32  protected $caldavBackend;
33 
39  protected $principalUri;
40 
47  function __construct(CalDAV\Backend\NotificationSupport $caldavBackend, $principalUri) {
48 
49  $this->caldavBackend = $caldavBackend;
50  $this->principalUri = $principalUri;
51 
52  }
53 
59  function getChildren() {
60 
61  $children = [];
62  $notifications = $this->caldavBackend->getNotificationsForPrincipal($this->principalUri);
63 
64  foreach ($notifications as $notification) {
65 
66  $children[] = new Node(
67  $this->caldavBackend,
68  $this->principalUri,
69  $notification
70  );
71  }
72 
73  return $children;
74 
75  }
76 
82  function getName() {
83 
84  return 'notifications';
85 
86  }
87 
95  function getOwner() {
96 
97  return $this->principalUri;
98 
99  }
100 
101 }
getChildren()
Returns all notifications for a principal.
Definition: Collection.php:59
This node represents a list of notifications.
Definition: Collection.php:23
This node represents a single notification.
Definition: Node.php:21
__construct(CalDAV\Backend\NotificationSupport $caldavBackend, $principalUri)
Constructor.
Definition: Collection.php:47
Collection class.
Definition: Collection.php:15
getOwner()
Returns the owner principal.
Definition: Collection.php:95
ACL-enabled node.
Definition: IACL.php:16
getName()
Returns the name of this object.
Definition: Collection.php:82
This node represents a list of notifications.
Definition: ICollection.php:21