ILIAS  release_8 Revision v8.24
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
52 private ?Closure $content_wrapper = null;
53 private ?Component $content = null;
54 private string $title = '';
55 private bool $supports_async_loading = false;
56
61 {
62 $clone = clone($this);
63 $clone->content_wrapper = $content_wrapper;
64
65 return $clone;
66 }
67
71 public function withContent(Component $ui_component): hasContent
72 {
73 $clone = clone($this);
74 $clone->content = $ui_component;
75
76 return $clone;
77 }
78
82 public function getContent(): Component
83 {
84 if ($this->content_wrapper !== null) {
85 $wrapper = $this->content_wrapper;
86
87 return $wrapper();
88 }
89
90 return $this->content;
91 }
92
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:60
withContent(Component $ui_component)
@inheritDoc
Definition: Complex.php:71
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:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Complex.php:21
trait hasSymbolTrait
Trait hasSymbolTrait.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...