ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
StandardNotificationGroup.php
Go to the documentation of this file.
2 
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  {
68  return $this->notifications;
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 
107  {
108  return new StandardNotificationGroupRenderer($factory);
109  }
110 }
$factory
Definition: metadata.php:58