ILIAS  release_7 Revision v7.30-3-g800a261c036
Bulky.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
5/* Copyright (c) 2019 Nils Haagen <nils.haagen@concepts-and-training.de> Extended GPL, see docs/LICENSE */
6
8
11
12class Bulky extends Link implements C\Link\Bulky
13{
15
16 // allowed ARIA roles
17 public const MENUITEM = 'menuitem';
18
22 protected $label;
23
27 protected $aria_role;
28
32 protected $symbol;
33
37 protected static $allowed_aria_roles = array(
38 self::MENUITEM
39 );
40
41 public function __construct(C\Symbol\Symbol $symbol, string $label, \ILIAS\Data\URI $target)
42 {
43 parent::__construct($target->__toString());
44 $this->label = $label;
45 $this->symbol = $symbol;
46 }
47
51 public function getLabel() : string
52 {
53 return $this->label;
54 }
55
59 public function getSymbol() : C\Symbol\Symbol
60 {
61 return $this->symbol;
62 }
63
70 public function withAriaRole(string $aria_role) : Bulky
71 {
72 $this->checkArgIsElement(
73 "role",
74 $aria_role,
75 self::$allowed_aria_roles,
76 implode('/', self::$allowed_aria_roles)
77 );
78 $clone = clone $this;
79 $clone->aria_role = $aria_role;
80 return $clone;
81 }
82
88 public function getAriaRole() : ?string
89 {
90 return $this->aria_role;
91 }
92}
An exception for terminatinating execution or to throw for unit testing.
This describes a symbol.
Definition: Symbol.php:12
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.
checkArgIsElement($which, $value, $array, $name)
Throw an InvalidArgumentException if $value is not an element of array.
Class ChatMainBarProvider \MainMenu\Provider.