ILIAS  release_7 Revision v7.30-3-g800a261c036
StandardNotificationGroup.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
21
24use ILIAS\UI\Factory as UIFactory;
25
32{
36 private $notifications = [];
37
41 protected $title = "";
42
43 public function withTitle(string $title) : self
44 {
45 $clone = clone $this;
46 $clone->title = $title;
47
48 return $clone;
49 }
50
54 public function getTitle() : string
55 {
56 return $this->title;
57 }
58
59 public function addNotification(StandardNotification $notification) : self
60 {
61 $this->notifications[] = $notification;
62
63 return $this;
64 }
65
69 public function getNotifications() : array
70 {
72 }
73
77 public function getNotificationsCount() : int
78 {
79 return count($this->notifications);
80 }
81
85 public function getOldNotificationsCount() : int
86 {
87 $count = 0;
88 foreach ($this->notifications as $notification) {
89 $count += $notification->getOldAmount();
90 }
91 return $count;
92 }
93
97 public function getNewNotificationsCount() : int
98 {
99 $count = 0;
100 foreach ($this->notifications as $notification) {
101 $count += $notification->getNewAmount();
102 }
103 return $count;
104 }
105
109 public function getRenderer(UIFactory $factory) : NotificationRenderer
110 {
112 }
113}
An exception for terminatinating execution or to throw for unit testing.
Class StandardNotificationGroup Groups a set of Notification.
Class Notification The default Notification mapping currently to one UI Notification Item component.
Interface NotificationRenderer Every Notification should have a renderer, if you won't provide on in ...
This is how the factory for UI elements looks.
Definition: Factory.php:18
$factory
Definition: metadata.php:58