ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
StandardNotificationGroup.php
Go to the documentation of this file.
2
5use ILIAS\UI\Factory as UIFactory;
6
15{
16
20 private $notifications = [];
21
25 protected $title = "";
26
27
32 public function withTitle(string $title) : StandardNotificationGroup
33 {
34 $clone = clone $this;
35 $clone->title = $title;
36
37 return $clone;
38 }
39
40
44 public function getTitle() : string
45 {
46 return $this->title;
47 }
48
49
56 {
57 $this->notifications[] = $notification;
58
59 return $this;
60 }
61
62
66 public function getNotifications() : array
67 {
69 }
70
74 public function getNotificationsCount() : int
75 {
76 return count($this->notifications);
77 }
78
82 public function getOldNotificationsCount() : int
83 {
84 $count = 0;
85 foreach ($this->notifications as $notification) {
86 $count += $notification->getOldAmount();
87 }
88 return $count;
89 }
90
94 public function getNewNotificationsCount() : int
95 {
96 $count = 0;
97 foreach ($this->notifications as $notification) {
98 $count += $notification->getNewAmount();
99 }
100 return $count;
101 }
102
106 public function getRenderer(UIFactory $factory) : NotificationRenderer
107 {
109 }
110}
An exception for terminatinating execution or to throw for unit testing.
This is how the factory for UI elements looks.
Definition: Factory.php:18
$factory
Definition: metadata.php:58