ILIAS  release_7 Revision v7.30-3-g800a261c036
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;
35
40class Complex extends AbstractChildItem implements
47{
50 use isInterchangeableItemTrait;
51
59 private $content;
63 private $title = '';
67 private $supports_async_loading = false;
68
73 {
74 $clone = clone($this);
75 $clone->content_wrapper = $content_wrapper;
76
77 return $clone;
78 }
79
83 public function withContent(Component $ui_component) : hasContent
84 {
85 $clone = clone($this);
86 $clone->content = $ui_component;
87
88 return $clone;
89 }
90
94 public function getContent() : Component
95 {
96 if ($this->content_wrapper !== null) {
97 $wrapper = $this->content_wrapper;
98
99 return $wrapper();
100 }
101
102 return $this->content;
103 }
104
109 public function withTitle(string $title) : hasTitle
110 {
111 $clone = clone($this);
112 $clone->title = $title;
113
114 return $clone;
115 }
116
120 public function getTitle() : string
121 {
122 return $this->title;
123 }
124
129 {
130 $clone = clone($this);
131 $clone->supports_async_loading = $supported;
132
133 return $clone;
134 }
135
139 public function supportsAsynchronousLoading() : bool
140 {
142 }
143}
An exception for terminatinating execution or to throw for unit testing.
withSupportsAsynchronousLoading(bool $supported)
@inheritDoc
Definition: Complex.php:128
withContentWrapper(Closure $content_wrapper)
@inheritDoc
Definition: Complex.php:72
withContent(Component $ui_component)
@inheritDoc
Definition: Complex.php:83
Interface hasSymbol Methods for Entries with Symbols.
Definition: hasSymbol.php:33
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:14
trait hasSymbolTrait
Trait hasSymbolTrait.