ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
DecoratorApplierTrait.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
28
32trait DecoratorApplierTrait
33{
34 private function applyTopics(HasHelpTopics $component, isDecorateable $item): Component
35 {
36 return $component->withHelpTopics(...$item->getTopics());
37 }
38
39 public function applyComponentDecorator(Component $component, isGlobalScreenItem $item): Component
40 {
41 $c = $item->getComponentDecorator();
42 if ($c !== null) {
43 return $c($component);
44 }
45
46 return $component;
47 }
48
49 public function applySymbolDecorator(Symbol $symbol, isGlobalScreenItem $item): Symbol
50 {
51 $c = $item->getSymbolDecorator();
52 if ($c !== null) {
53 return $c($symbol);
54 }
55
56 return $symbol;
57 }
58}
$c
Definition: deliver.php:25
A component is the most general form of an entity in the UI.
Definition: Component.php:28
withHelpTopics(Topic ... $topics)
Let this component have the given topics.
This describes a symbol.
Definition: Symbol.php:30