ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
hasSymbolTrait.php
Go to the documentation of this file.
2 
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 }
This describes a symbol.
Definition: Symbol.php:11
Interface hasSymbol Methods for Entries with Symbols.
Definition: hasSymbol.php:11