19 declare(strict_types=1);
42 $this->observer_groups[$event->value][] = $observer;
49 foreach ($this->observer_groups[$event->value] as $index => $attached_observer) {
50 if ($attached_observer->getId() === $observer->
getId()) {
51 unset($this->observer_groups[$event->value][$index]);
60 $observers = array_merge(
62 $this->observer_groups[$event->value],
65 foreach ($observers as $interessted_observer) {
66 $interessted_observer->update($event, $data);
72 if (!isset($this->observer_groups[$group])) {
73 $this->observer_groups[$group] = [];
initObserverGroup(string $group)
event string being used if
detach(ilCtrlObserver $observer, ilCtrlEvent $event=ilCtrlEvent::ALL)
attach(ilCtrlObserver $observer, ilCtrlEvent $event)
notify(ilCtrlEvent $event, ?string $data)
getId()
Unique identifier of the implementing event-listener.