ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
AbstractPlaceholderHandler.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use ilLanguage;
25
26abstract class AbstractPlaceholderHandler implements Placeholder
27{
28 protected ?Placeholder $next = null;
29
30 public function __construct(protected ilLanguage $lng)
31 {
32 }
33
34 public function getLabel(): string
35 {
36 return $this->lng->txt('mail_nacc_' . strtolower($this->getId()));
37 }
38
40 {
41 $this->next = $next;
42
43 return $next;
44 }
45
46 public function getNext(): ?Placeholder
47 {
48 return $this->next;
49 }
50
54 public function handle(Signature $signature): array
55 {
56 $placeholders = [];
57
58 if ($this->next) {
59 $placeholders = $this->next->handle($signature);
60 }
61
62 if ($signature->supports($this)) {
63 $placeholders = $this->addPlaceholder($placeholders);
64 }
65
66 return $placeholders;
67 }
68
73 abstract public function addPlaceholder(array $placeholder): array;
74}
language handling
supports(Placeholder $placeholder)
global $lng
Definition: privfeed.php:31