ILIAS
release_6 Revision v6.24-5-g0c8bfefb3b8
◀ ilDoc Overview
hasSymbolTrait.php
Go to the documentation of this file.
1
<?php
namespace
ILIAS\GlobalScreen\Scope\MainMenu\Factory
;
2
3
use
ILIAS\UI\Component\Symbol\Symbol
;
4
9
trait
hasSymbolTrait
10
{
14
protected
$symbol;
15
19
public
function
withSymbol
(
Symbol
$symbol) :
hasSymbol
20
{
21
// bugfix mantis 25526: make aria labels mandatory
22
if
(($symbol instanceof Icon\Icon || $symbol instanceof Glyph\Glyph)
23
&& ($symbol->getAriaLabel() ===
""
)) {
24
throw
new \LogicException(
"the symbol's aria label MUST be set to ensure accessibility"
);
25
}
26
27
$clone = clone $this;
28
$clone->symbol = $symbol;
29
30
return
$clone;
31
}
32
36
public
function
getSymbol
() :
Symbol
37
{
38
return
$this->symbol;
39
}
40
44
public
function
hasSymbol
() : bool
45
{
46
return
$this->symbol instanceof
Symbol
;
47
}
48
}
ILIAS\GlobalScreen\Scope\MainMenu\Factory\getSymbol
getSymbol()
Definition:
hasSymbolTrait.php:36
ILIAS\UI\Component\Symbol\Symbol
This describes a symbol.
Definition:
Symbol.php:11
Symbol
hasSymbolTrait
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasSymbol
hasSymbol()
Definition:
hasSymbolTrait.php:44
ILIAS\GlobalScreen\Scope\MainMenu\Factory\withSymbol
withSymbol(Symbol $symbol)
Definition:
hasSymbolTrait.php:19
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasSymbol
Interface hasSymbol Methods for Entries with Symbols.
Definition:
hasSymbol.php:11
ILIAS\GlobalScreen\Scope\MainMenu\Factory
Definition:
AbstractBaseItem.php:1
src
GlobalScreen
Scope
MainMenu
Factory
hasSymbolTrait.php
Generated on Mon Sep 1 2025 20:01:41 for ILIAS by
1.8.13 (using
Doxyfile
)