ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
AbstractBaseNotification.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
26use ILIAS\UI\Factory as UIFactory;
27use Closure;
28
34{
38 protected ?Closure $handle_opened = null;
39
43 protected ?Closure $handle_closed = null;
44
49 public function __construct(protected IdentificationInterface $provider_identification)
50 {
51 $this->handle_opened = function (): void {
52 };
53 }
54
59 {
60 return $this->provider_identification;
61 }
62
66 public function getRenderer(UIFactory $factory): NotificationRenderer
67 {
68 return new StandardNotificationRenderer($factory);
69 }
70
74 public function withOpenedCallable(callable $handle_opened): isItem
75 {
76 $clone = clone $this;
77 $clone->handle_opened = $handle_opened;
78 return $clone;
79 }
80
84 public function getOpenedCallable(): callable
85 {
87 }
88
92 public function withClosedCallable(callable $handle_closed): isItem
93 {
94 $clone = clone $this;
95 $clone->handle_closed = $handle_closed;
96 return $clone;
97 }
98
102 public function getClosedCallable(): ?callable
103 {
105 }
106
110 public function hasClosedCallable(): bool
111 {
112 return is_callable($this->handle_closed);
113 }
114}
Builds a Color from either hex- or rgb values.
Definition: Factory.php:31
Closure $handle_opened
Callable to be executed, if the notification center has been opened.
Closure $handle_closed
Callable to be executed, if this specific item has been closed.
__construct(protected IdentificationInterface $provider_identification)
StandardNotification constructor.
Interface NotificationRenderer Every Notification should have a renderer, if you won't provide on in ...