ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
StandardNotificationGroup.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
26 
33 {
37  private array $notifications = [];
38 
42  protected string $title = "";
43 
44  public function withTitle(string $title): self
45  {
46  $clone = clone $this;
47  $clone->title = $title;
48 
49  return $clone;
50  }
51 
55  public function getTitle(): string
56  {
57  return $this->title;
58  }
59 
60  public function addNotification(StandardNotification $notification): self
61  {
62  $this->notifications[] = $notification;
63 
64  return $this;
65  }
66 
70  public function getNotifications(): array
71  {
72  return $this->notifications;
73  }
74 
78  public function getNotificationsCount(): int
79  {
80  return count($this->notifications);
81  }
82 
86  public function getOldNotificationsCount(): int
87  {
88  $count = 0;
89  foreach ($this->notifications as $notification) {
90  $count += $notification->getOldAmount();
91  }
92  return $count;
93  }
94 
98  public function getNewNotificationsCount(): int
99  {
100  $count = 0;
101  foreach ($this->notifications as $notification) {
102  $count += $notification->getNewAmount();
103  }
104  return $count;
105  }
106 
110  #[\Override]
111  public function getRenderer(UIFactory $factory): NotificationRenderer
112  {
113  return new StandardNotificationGroupRenderer($factory);
114  }
115 }
Class Notification The default Notification mapping currently to one UI Notification Item component...
Class StandardNotificationGroup Groups a set of Notification.
Interface NotificationRenderer Every Notification should have a renderer, if you won&#39;t provide on in ...