ILIAS  release_8 Revision v8.23
TopParentItem.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
26 
32 {
34 
38  protected array $children = [];
39  protected ?Symbol $symbol = null;
40  protected string $title = "";
41 
46  {
47  parent::__construct($provider_identification);
48  $this->renderer = new TopParentItemRenderer();
49  }
50 
54  public function withSymbol(Symbol $symbol): hasSymbol
55  {
56  $clone = clone($this);
57  $clone->symbol = $symbol;
58 
59  return $clone;
60  }
61 
65  public function getSymbol(): Symbol
66  {
67  return $this->symbol;
68  }
69 
73  public function hasSymbol(): bool
74  {
75  return ($this->symbol instanceof Symbol);
76  }
77 
81  public function withTitle(string $title): hasTitle
82  {
83  $clone = clone($this);
84  $clone->title = $title;
85 
86  return $clone;
87  }
88 
92  public function getTitle(): string
93  {
94  return $this->title;
95  }
96 
100  public function getChildren(): array
101  {
102  return $this->children;
103  }
104 
108  public function withChildren(array $children): isParent
109  {
110  $clone = clone($this);
111  $clone->children = $children;
112 
113  return $clone;
114  }
115 
119  public function appendChild(isChild $child): isParent
120  {
121  $this->children[] = $child;
122 
123  return $this;
124  }
125 
129  public function hasChildren(): bool
130  {
131  return $this->children !== [];
132  }
133 }
This describes a symbol.
Definition: Symbol.php:29
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(IdentificationInterface $provider_identification)
__construct(Container $dic, ilPlugin $plugin)