ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
AbstractPlaceholderHandler.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
23 use ilLanguage;
25 
26 abstract 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 
39  public function setNext(Placeholder $next): Placeholder
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 }
supports(Placeholder $placeholder)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $lng
Definition: privfeed.php:31