ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
StandardNotification.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use ILIAS\UI\Component\Item\Notification as NotificationItem;
24
31{
35 private NotificationItem $notification_item;
40 private int $old_amount = 0;
45 private int $new_amount = 1;
46
47 public function withNotificationItem(NotificationItem $notification_item): self
48 {
49 $clone = clone $this;
50 $clone->notification_item = $notification_item;
51
52 return $clone;
53 }
54
58 public function getNotificationItem(): NotificationItem
59 {
61 }
62
66 public function withOldAmount(int $amount = 0): StandardNotification
67 {
68 $clone = clone $this;
69 $clone->old_amount = $amount;
70
71 return $clone;
72 }
73
77 public function withNewAmount(int $amount = 0): StandardNotification
78 {
79 $clone = clone $this;
80 $clone->new_amount = $amount;
81
82 return $clone;
83 }
84
88 public function getOldAmount(): int
89 {
90 return $this->old_amount;
91 }
92
96 public function getNewAmount(): int
97 {
98 return $this->new_amount;
99 }
100}
Class Notification The default Notification mapping currently to one UI Notification Item component.
getNewAmount()
Get the amount of new notes, the notification contains.int
int $new_amount
Amount of old notes, the notification contains.
NotificationItem $notification_item
UI Component mapping to this item.
withNewAmount(int $amount=0)
Set the amount of new notes, the notification contains.StandardNotification
getOldAmount()
Get the amount of new notes, the notification contains.int
withOldAmount(int $amount=0)
Set the amount of old notes, the notification contains.StandardNotification
int $old_amount
Amount of old notes, the notification contains.
Interface hasAmount Items can implicitly contain a various amount of news.
Definition: hasAmount.php:32