1 | <?php |
||
46 | class BaseContainer |
||
47 | { |
||
48 | /** |
||
49 | * the information we are storing |
||
50 | * @var array |
||
51 | */ |
||
52 | private $data = []; |
||
53 | |||
54 | /** |
||
55 | * retrieve a single piece of information |
||
56 | * |
||
57 | * @param string $key |
||
58 | * the information to retrieve |
||
59 | * @return mixed |
||
60 | * the information found |
||
61 | */ |
||
62 | protected function getData($key) |
||
71 | |||
72 | /** |
||
73 | * retrieve all of the information we have |
||
74 | * |
||
75 | * @return array |
||
76 | */ |
||
77 | protected function getAllData() |
||
81 | |||
82 | /** |
||
83 | * store a single piece of information |
||
84 | * |
||
85 | * @param string $key |
||
86 | * the name of this information |
||
87 | * @param mixed $value |
||
88 | * the information to store |
||
89 | */ |
||
90 | protected function setData($key, $value) |
||
94 | |||
95 | /** |
||
96 | * do we have a given piece of information? |
||
97 | * |
||
98 | * @param string $key |
||
99 | * the information to check for |
||
100 | * @return boolean |
||
101 | * TRUE if we have the information |
||
102 | * FALSE otherwise |
||
103 | */ |
||
104 | protected function hasData($key) |
||
108 | |||
109 | /** |
||
110 | * delete a piece of data (if we have it) |
||
111 | * |
||
112 | * @param string $key |
||
113 | * the information to delete |
||
114 | * @return void |
||
115 | */ |
||
116 | protected function resetData($key) |
||
124 | } |