1 | <?php |
||
13 | class StorageList |
||
14 | { |
||
15 | |||
16 | /** |
||
17 | * Data to initialize the list. |
||
18 | * |
||
19 | * @var mixed |
||
20 | */ |
||
21 | private $initData; |
||
22 | |||
23 | /** |
||
24 | * List. |
||
25 | * |
||
26 | * @var array |
||
27 | */ |
||
28 | private $list; |
||
29 | |||
30 | /** |
||
31 | * Sets incoming values. |
||
32 | * |
||
33 | * @param mixed $initData Data to initialize the list. |
||
34 | */ |
||
35 | 2 | public function __construct($initData) |
|
39 | |||
40 | /** |
||
41 | * Sets data to initialize the list. |
||
42 | * |
||
43 | * @param mixed $initData Data for initialization. |
||
44 | * |
||
45 | * @return self |
||
46 | */ |
||
47 | 2 | private function setInitData($initData) |
|
52 | |||
53 | /** |
||
54 | * Gets data to initialize the list. |
||
55 | * |
||
56 | * @return mixed |
||
57 | */ |
||
58 | 2 | private function getInitData() |
|
62 | |||
63 | /** |
||
64 | * Gets value of by key name. |
||
65 | * |
||
66 | * @param string $keyName Key name. |
||
67 | * @param mixed $defaultValue Default value. |
||
68 | * |
||
69 | * @return string|mixed |
||
70 | */ |
||
71 | 1 | public function get($keyName, $defaultValue = null) |
|
80 | |||
81 | /** |
||
82 | * Returns the container as an array. |
||
83 | * |
||
84 | * @return array |
||
85 | */ |
||
86 | 2 | public function toArray() |
|
93 | |||
94 | /** |
||
95 | * Sets the list. |
||
96 | * |
||
97 | * @param array $list List. |
||
98 | * |
||
99 | * @return self |
||
100 | */ |
||
101 | 2 | protected function setList(array $list) |
|
106 | |||
107 | /** |
||
108 | * Initializes and sets the list. |
||
109 | */ |
||
110 | 2 | protected function initList() |
|
114 | } |
||
115 |