ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
NotificationCenter.php
Go to the documentation of this file.
2 
6 
13 {
14 
22 
30 
35  private $notifications = [];
36 
37 
42  {
43  parent::__construct($provider_identification);
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  {
67  return $this->notifications;
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 
121  public function withAmountOfOldNotifications(int $amount) : NotificationCenter
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 
145  public function withAmountOfNewNotifications(int $amount) : NotificationCenter
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 }
This describes a symbol.
Definition: Symbol.php:11
getAmountOfNewNotifications()
Get the amount of new notifications.
withAmountOfOldNotifications(int $amount)
Get a Center like this, but with a given amount of old notifications.
__construct(IdentificationInterface $provider_identification)
withAmountOfNewNotifications(int $amount)
Get a Center like this, but with a given amount of new notifications.
getAmountOfOldNotifications()
Get the amount of old notifications.
__construct(Container $dic, ilPlugin $plugin)
$DIC
Definition: xapitoken.php:46