ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
NotificationCenter.php
Go to the documentation of this file.
2
6
13{
14
22
30
35 private $notifications = [];
36
37
42 {
44 $this->renderer = new NotificationCenterRenderer();
45 }
46
47
54 {
55 $clone = clone($this);
56 $clone->notifications = $notifications;
57
58 return $clone;
59 }
60
61
65 public function getNotifications() : array
66 {
68 }
69
70
74 public function withSymbol(Symbol $symbol) : hasSymbol
75 {
76 return $this;
77 }
78
79
83 public function hasSymbol() : bool
84 {
85 return true;
86 }
87
88
92 public function getSymbol() : Symbol
93 {
94 global $DIC;
95
96 $f = $DIC->ui()->factory();
97 $new = $this->getAmountOfNewNotifications();
98 $old = $this->getAmountOfOldNotifications() - $new;
99 $glyph = $f->symbol()->glyph()->notification()->withCounter($f->counter()->novelty($new));
100 if ($old > 0) {
101 $glyph = $glyph->withCounter($f->counter()->status($old));
102 }
103 return $glyph;
104 }
105
106
110 public function getPosition() : int
111 {
112 return 1;
113 }
114
122 {
123 $clone = clone($this);
124 $clone->amount_of_old_notifications = $amount;
125
126 return $clone;
127 }
128
134 public function getAmountOfOldNotifications() : int
135 {
137 }
138
146 {
147 $clone = clone($this);
148 $clone->amount_of_new_notifications = $amount;
149
150 return $clone;
151 }
152
158 public function getAmountOfNewNotifications() : int
159 {
161 }
162}
An exception for terminatinating execution or to throw for unit testing.
getAmountOfNewNotifications()
Get the amount of new notifications.
getAmountOfOldNotifications()
Get the amount of old notifications.
__construct(IdentificationInterface $provider_identification)
@inheritDoc
withAmountOfNewNotifications(int $amount)
Get a Center like this, but with a given amount of new notifications.
withAmountOfOldNotifications(int $amount)
Get a Center like this, but with a given amount of old notifications.
This describes a symbol.
Definition: Symbol.php:12
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$DIC
Definition: xapitoken.php:46