ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
TopParentItem.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
26 
32 {
33  use ContentLanguage;
35 
39  protected array $children = [];
40  protected ?Symbol $symbol = null;
41  protected string $title = "";
42 
47  {
48  parent::__construct($provider_identification);
49  $this->renderer = new TopParentItemRenderer();
50  }
51 
55  public function withSymbol(Symbol $symbol): hasSymbol
56  {
57  $clone = clone($this);
58  $clone->symbol = $symbol;
59 
60  return $clone;
61  }
62 
66  public function getSymbol(): Symbol
67  {
68  return $this->symbol;
69  }
70 
74  public function hasSymbol(): bool
75  {
76  return ($this->symbol instanceof Symbol);
77  }
78 
82  public function withTitle(string $title): hasTitle
83  {
84  $clone = clone($this);
85  $clone->title = $title;
86 
87  return $clone;
88  }
89 
93  public function getTitle(): string
94  {
95  return $this->title;
96  }
97 
101  public function getChildren(): array
102  {
103  return $this->children;
104  }
105 
109  public function withChildren(array $children): isParent
110  {
111  $clone = clone($this);
112  $clone->children = $children;
113 
114  return $clone;
115  }
116 
120  public function appendChild(isChild $child): isParent
121  {
122  $this->children[] = $child;
123 
124  return $this;
125  }
126 
130  public function hasChildren(): bool
131  {
132  return count($this->children) > 0;
133  }
134 }
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(VocabulariesInterface $vocabularies)