ILIAS  trunk Revision v11.0_alpha-2658-ge2404539063
StandardNotification.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
24 
31 {
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 
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 }
getOldAmount()
Get the amount of new notes, the notification contains.int
Class Notification The default Notification mapping currently to one UI Notification Item component...
NotificationItem $notification_item
UI Component mapping to this item.
int $new_amount
Amount of old notes, the notification contains.
Interface hasAmount Items can implicitly contain a various amount of news.
Definition: hasAmount.php:31
int $old_amount
Amount of old notes, the notification contains.
getNewAmount()
Get the amount of new notes, the notification contains.int
withOldAmount(int $amount=0)
Set the amount of old notes, the notification contains.StandardNotification
withNewAmount(int $amount=0)
Set the amount of new notes, the notification contains.StandardNotification