ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
Complex.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
23 use Closure;
35 
40 class Complex extends AbstractChildItem implements
41  hasContent,
42  hasTitle,
43  hasSymbol,
46  isChild
47 {
49  use hasSymbolTrait;
51 
52  private ?Closure $content_wrapper = null;
53  private ?Component $content = null;
54  private string $title = '';
55  private bool $supports_async_loading = false;
56 
60  public function withContentWrapper(Closure $content_wrapper): hasContent
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 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Complex.php:21
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface supportsAsynchronousLoading Types, which implement this interface, can load their content a...
Interface hasSymbol Methods for Entries with Symbols.
Definition: hasSymbol.php:32
trait hasSymbolTrait
Trait hasSymbolTrait.