ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
TreeTool.php
Go to the documentation of this file.
1<?php declare(strict_types=1);
2
4
13
19{
24 protected $symbol;
28 protected $tree;
32 protected $title;
33
38 public function withTitle(string $title) : hasTitle
39 {
40 $clone = clone($this);
41 $clone->title = $title;
42
43 return $clone;
44 }
45
49 public function getTitle() : string
50 {
51 return $this->title;
52 }
53
58 {
59 // bugfix mantis 25526: make aria labels mandatory
60 if (($symbol instanceof Icon\Icon || $symbol instanceof Glyph\Glyph)
61 && ($symbol->getAriaLabel() === "")
62 ) {
63 throw new \LogicException("the symbol's aria label MUST be set to ensure accessibility");
64 }
65
66 $clone = clone($this);
67 $clone->symbol = $symbol;
68
69 return $clone;
70 }
71
75 public function withTree(Tree $tree) : TreeTool
76 {
77 $clone = clone($this);
78 $clone->tree = $tree;
79
80 return $clone;
81 }
82
86 public function getTree() : Tree
87 {
88 return $this->tree;
89 }
90
94 public function getSymbol() : Symbol
95 {
96 return $this->symbol;
97 }
98
102 public function hasSymbol() : bool
103 {
104 return ($this->symbol instanceof Symbol);
105 }
106}
An exception for terminatinating execution or to throw for unit testing.
withSymbol(Symbol $symbol)
@inheritDoc
Definition: TreeTool.php:57
Interface hasSymbol Methods for Entries with Symbols.
Definition: hasSymbol.php:12
This describes how a glyph could be modified during construction of UI.
Definition: Glyph.php:14
This describes how a icon could be modified during construction of UI.
Definition: Icon.php:10
This describes a symbol.
Definition: Symbol.php:12
This describes a Tree Control.
Definition: Tree.php:14