ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
LabeledMenu.php
Go to the documentation of this file.
1<?php
2declare(strict_types=1);
3
4/* Copyright (c) 2019 Nils Haagen <nils.haagen@concepts-and-training.de> Extended GPL, see docs/LICENSE */
5
7
8use ILIAS\UI\Component as Component;
11
15abstract class LabeledMenu extends Menu implements IMenu\LabeledMenu
16{
18
22 protected $label;
23
27 public function getLabel()
28 {
29 return $this->label;
30 }
31
35 public function withLabel($label) : IMenu\LabeledMenu
36 {
38 $clone = clone $this;
39 $clone->label = $label;
40 return $clone;
41 }
42
46 protected function checkLabelParameter($label)
47 {
48 $classes = [Component\Clickable::class, \string::class];
49 $check = [$label];
50 $this->checkArgListElements("label", $check, $classes);
51 }
52}
An exception for terminatinating execution or to throw for unit testing.
getLabel()
Get the label for this menu.Component\Clickable | string
Definition: LabeledMenu.php:27
This describes a Menu Control with a label.
Definition: LabeledMenu.php:14
This describes a Menu Control.
Definition: Menu.php:14
checkArgListElements($which, array &$values, $classes)
Check every element of the list if it is an instance of one of the given classes.
trait ComponentHelper
Provides common functionality for component implementations.