1 | <?php |
||
11 | class Db implements Storage\StorageInterface |
||
12 | { |
||
13 | /** |
||
14 | * @var StorageInterface |
||
15 | */ |
||
16 | protected $storage; |
||
17 | |||
18 | /** |
||
19 | * @var UserMapper |
||
20 | */ |
||
21 | protected $mapper; |
||
22 | |||
23 | /** |
||
24 | * @var mixed |
||
25 | */ |
||
26 | protected $resolvedIdentity; |
||
27 | |||
28 | /** |
||
29 | * @var ServiceManager |
||
30 | */ |
||
31 | protected $serviceManager; |
||
32 | |||
33 | public function __construct(ServiceManager $serviceManager) |
||
37 | |||
38 | /** |
||
39 | * Returns true if and only if storage is empty |
||
40 | * |
||
41 | * @throws \Zend\Authentication\Exception\InvalidArgumentException If it is impossible to determine whether |
||
42 | * storage is empty or not |
||
43 | * @return boolean |
||
44 | */ |
||
45 | public function isEmpty() |
||
58 | |||
59 | /** |
||
60 | * Returns the contents of storage |
||
61 | * |
||
62 | * Behavior is undefined when storage is empty. |
||
63 | * |
||
64 | * @throws \Zend\Authentication\Exception\InvalidArgumentException If reading contents from storage is impossible |
||
65 | * @return mixed |
||
66 | */ |
||
67 | public function read() |
||
87 | |||
88 | /** |
||
89 | * Writes $contents to storage |
||
90 | * |
||
91 | * @param mixed $contents |
||
92 | * @throws \Zend\Authentication\Exception\InvalidArgumentException If writing $contents to storage is impossible |
||
93 | * @return void |
||
94 | */ |
||
95 | public function write($contents) |
||
100 | |||
101 | /** |
||
102 | * Clears contents from storage |
||
103 | * |
||
104 | * @throws \Zend\Authentication\Exception\InvalidArgumentException If clearing contents from storage is impossible |
||
105 | * @return void |
||
106 | */ |
||
107 | public function clear() |
||
112 | |||
113 | /** |
||
114 | * getStorage |
||
115 | * |
||
116 | * @return Storage\StorageInterface |
||
117 | */ |
||
118 | public function getStorage() |
||
125 | |||
126 | /** |
||
127 | * setStorage |
||
128 | * |
||
129 | * @param Storage\StorageInterface $storage |
||
130 | * @access public |
||
131 | * @return Db |
||
132 | */ |
||
133 | public function setStorage(Storage\StorageInterface $storage) |
||
138 | |||
139 | /** |
||
140 | * getMapper |
||
141 | * |
||
142 | * @return UserMapper |
||
143 | */ |
||
144 | public function getMapper() |
||
151 | |||
152 | /** |
||
153 | * setMapper |
||
154 | * |
||
155 | * @param UserMapper $mapper |
||
156 | * @return Db |
||
157 | */ |
||
158 | public function setMapper(UserMapper $mapper) |
||
163 | |||
164 | /** |
||
165 | * Retrieve service manager instance |
||
166 | * |
||
167 | * @return ServiceManager |
||
168 | */ |
||
169 | public function getServiceManager() |
||
173 | |||
174 | /** |
||
175 | * Set service manager instance |
||
176 | * |
||
177 | * @param ServiceManager $locator |
||
178 | * @return void |
||
179 | */ |
||
180 | public function setServiceManager(ServiceManager $serviceManager) |
||
184 | } |
||
185 |