ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
StandardNotificationGroup.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
21 
25 
32 {
36  private array $notifications = [];
37 
41  protected string $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  {
71  return $this->notifications;
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 
110  {
111  return new StandardNotificationGroupRenderer($factory);
112  }
113 }
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 ...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$factory
Definition: metadata.php:75