4 * This node represents a list of notifications.
6 * It provides no additional functionality, but you must implement this
7 * interface to allow the Notifications addon to mark the collection
8 * as a notifications collection.
10 * This collection should only return Sabre_CalDAV_Notifications_INode nodes as
14 * @copyright Copyright (C) 2007-2012 Rooftop Solutions. All rights reserved.
15 * @author Evert Pot (http://www.rooftopsolutions.nl/)
16 * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
18 class Sabre_CalDAV_Notifications_Collection extends Sabre_DAV_Collection implements Sabre_CalDAV_Notifications_ICollection {
21 * The notification backend
23 * @var Sabre_CalDAV_Backend_NotificationSupport
25 protected $caldavBackend;
32 protected $principalUri;
37 * @param Sabre_CalDAV_Backend_NotificationSupport $caldavBackend
38 * @param string $principalUri
40 public function __construct(Sabre_CalDAV_Backend_NotificationSupport $caldavBackend, $principalUri) {
42 $this->caldavBackend = $caldavBackend;
43 $this->principalUri = $principalUri;
48 * Returns all notifications for a principal
52 public function getChildren() {
55 $notifications = $this->caldavBackend->getNotificationsForPrincipal($this->principalUri);
57 foreach($notifications as $notification) {
59 $children[] = new Sabre_CalDAV_Notifications_Node(
70 * Returns the name of this object
74 public function getName() {
76 return 'notifications';