ILIAS
release_7 Revision v7.30-3-g800a261c036
◀ ilDoc Overview
hasSymbolTrait.php
Go to the documentation of this file.
1
<?
php
2
19
declare(strict_types=1);
20
namespace
ILIAS\GlobalScreen\Scope\MainMenu\Factory
;
21
22
use
ILIAS\UI\Component\Symbol\Glyph\Glyph
;
23
use
ILIAS\UI\Component\Symbol\Symbol
;
24
use
ILIAS\UI\Implementation\Component\Symbol\Icon\Icon
;
25
use LogicException;
26
31
trait
hasSymbolTrait
32
{
36
protected
$symbol;
37
41
public
function
withSymbol
(
Symbol
$symbol) :
hasSymbol
42
{
43
// bugfix mantis 25526: make aria labels mandatory
44
if
(($symbol instanceof
Glyph
&& $symbol->getAriaLabel() ===
""
) ||
45
($symbol instanceof
Icon
&& $symbol->getLabel() ===
""
)) {
46
throw
new
LogicException(
"the symbol's aria label MUST be set to ensure accessibility"
);
47
}
48
49
$clone = clone $this;
50
$clone->symbol = $symbol;
51
52
return
$clone;
53
}
54
58
public
function
getSymbol
() :
Symbol
59
{
60
return
$this->symbol;
61
}
62
66
public
function
hasSymbol
() : bool
67
{
68
return
$this->symbol instanceof
Symbol
;
69
}
70
}
php
An exception for terminatinating execution or to throw for unit testing.
ILIAS\UI\Implementation\Component\Symbol\Icon\Icon
Definition:
Icon.php:11
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasSymbol
Interface hasSymbol Methods for Entries with Symbols.
Definition:
hasSymbol.php:33
ILIAS\UI\Component\Symbol\Glyph\Glyph
This describes how a glyph could be modified during construction of UI.
Definition:
Glyph.php:14
ILIAS\UI\Component\Symbol\Symbol
This describes a symbol.
Definition:
Symbol.php:12
ILIAS\GlobalScreen\Scope\MainMenu\Factory
Definition:
AbstractBaseItem.php:21
ILIAS\GlobalScreen\Scope\MainMenu\Factory\getSymbol
getSymbol()
@inheritDoc
Definition:
hasSymbolTrait.php:58
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasSymbolTrait
trait hasSymbolTrait
Trait hasSymbolTrait.
Definition:
hasSymbolTrait.php:32
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasSymbol
hasSymbol()
@inheritDoc
Definition:
hasSymbolTrait.php:66
ILIAS\GlobalScreen\Scope\MainMenu\Factory\withSymbol
withSymbol(Symbol $symbol)
@inheritDoc
Definition:
hasSymbolTrait.php:41
src
GlobalScreen
Scope
MainMenu
Factory
hasSymbolTrait.php
Generated on Fri Oct 3 2025 21:01:10 for ILIAS by
1.9.4 (using
Doxyfile
)