Customizable.php
1.22 KB
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
62
63
64
65
66
67
68
69
70
71
72
<?php
namespace YahnisElsts\AdminMenuEditor\Customizable;
use YahnisElsts\AdminMenuEditor\Customizable\Storage\StorageInterface;
abstract class Customizable {
protected $id;
/**
* @var string
*/
protected $label = '';
/**
* @var string
*/
protected $description = '';
/**
* @var null|string
*/
protected $groupTitle = null;
/**
* @var StorageInterface
*/
protected $store = null;
public function __construct($id, StorageInterface $store = null, $params = array()) {
$this->id = $id;
$this->store = $store;
$this->label = isset($params['label']) ? $params['label'] : $id;
if ( isset($params['description']) ) {
$this->description = $params['description'];
}
if ( isset($params['groupTitle']) ) {
$this->groupTitle = $params['groupTitle'];
}
}
/**
* @return string
*/
public function getId() {
return $this->id;
}
/**
* @return string
*/
public function getLabel() {
return $this->label;
}
/**
* @return string
*/
public function getDescription() {
return $this->description;
}
/**
* @return string|null
*/
public function getCustomGroupTitle() {
return $this->groupTitle;
}
public function getStore() {
return $this->store;//todo: remove debug code
}
}