ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
Complex.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use Closure;
31use ILIAS\GlobalScreen\Scope\MainMenu\Factory\isInterchangeableItemTrait;
36
40class Complex extends AbstractChildItem implements
46 isChild,
48{
50 use isInterchangeableItemTrait;
52
53 private ?Closure $content_wrapper = null;
54 private ?Component $content = null;
55 private string $title = '';
56 private bool $supports_async_loading = false;
57
62 {
63 $clone = clone($this);
64 $clone->content_wrapper = $content_wrapper;
65
66 return $clone;
67 }
68
72 public function withContent(Component $ui_component): hasContent
73 {
74 $clone = clone($this);
75 $clone->content = $ui_component;
76
77 return $clone;
78 }
79
83 public function getContent(): Component
84 {
85 if ($this->content_wrapper !== null) {
86 $wrapper = $this->content_wrapper;
87
88 return $wrapper();
89 }
90
91 return $this->content;
92 }
93
97 public function withTitle(string $title): hasTitle
98 {
99 $clone = clone($this);
100 $clone->title = $title;
101
102 return $clone;
103 }
104
108 public function getTitle(): string
109 {
110 return $this->title;
111 }
112
117 {
118 $clone = clone($this);
119 $clone->supports_async_loading = $supported;
120
121 return $clone;
122 }
123
127 public function supportsAsynchronousLoading(): bool
128 {
130 }
131}
withSupportsAsynchronousLoading(bool $supported)
@inheritDoc
Definition: Complex.php:116
withContentWrapper(Closure $content_wrapper)
@inheritDoc
Definition: Complex.php:61
withContent(Component $ui_component)
@inheritDoc
Definition: Complex.php:72
Interface supportsAsynchronousLoading Types, which implement this interface, can load their content a...
A component is the most general form of an entity in the UI.
Definition: Component.php:28
trait hasSymbolTrait
Trait hasSymbolTrait.