/
MenuItem.php
61 lines (53 loc) · 1.28 KB
/
MenuItem.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
namespace LimeSurvey\Menu;
class MenuItem implements MenuItemInterface
{
protected $isDivider = false;
protected $isSmallText = false;
protected $href = "#";
protected $label = "Missing label";
protected $iconClass = "";
public function __construct($options)
{
if (isset($options['isDivider'])) {
$this->isDivider = $options['isDivider'];
}
if (isset($options['isSmallText'])) {
$this->isSmallText = $options['isSmallText'];
}
if (isset($options['label'])) {
$this->label = $options['label'];
}
if (isset($options['href'])) {
$this->href = $options['href'];
}
if (isset($options['iconClass'])) {
$this->iconClass = $options['iconClass'];
}
}
public function getHref()
{
return $this->href;
}
public function getLabel()
{
return $this->label;
}
public function getIconClass()
{
return $this->iconClass;
}
public function isDivider()
{
return $this->isDivider;
}
public function isSmallText()
{
return $this->isSmallText;
}
// Used by array_unique
public function __toString()
{
return $this->href;
}
}