ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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;
34
38class Complex extends AbstractChildItem implements
45{
47 use isInterchangeableItemTrait;
48
49 private ?Closure $content_wrapper = null;
50 private ?Component $content = null;
51 private string $title = '';
52 private bool $supports_async_loading = false;
53
58 {
59 $clone = clone($this);
60 $clone->content_wrapper = $content_wrapper;
61
62 return $clone;
63 }
64
68 public function withContent(Component $ui_component): hasContent
69 {
70 $clone = clone($this);
71 $clone->content = $ui_component;
72
73 return $clone;
74 }
75
79 public function getContent(): Component
80 {
81 if ($this->content_wrapper !== null) {
82 $wrapper = $this->content_wrapper;
83
84 return $wrapper();
85 }
86
87 return $this->content;
88 }
89
94 public function withTitle(string $title): hasTitle
95 {
96 $clone = clone($this);
97 $clone->title = $title;
98
99 return $clone;
100 }
101
105 public function getTitle(): string
106 {
107 return $this->title;
108 }
109
114 {
115 $clone = clone($this);
116 $clone->supports_async_loading = $supported;
117
118 return $clone;
119 }
120
124 public function supportsAsynchronousLoading(): bool
125 {
127 }
128}
withSupportsAsynchronousLoading(bool $supported)
@inheritDoc
Definition: Complex.php:113
withContentWrapper(Closure $content_wrapper)
@inheritDoc
Definition: Complex.php:57
withContent(Component $ui_component)
@inheritDoc
Definition: Complex.php:68
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.