1 | <?php |
||
9 | class Db implements Storage\StorageInterface |
||
10 | { |
||
11 | /** |
||
12 | * @var StorageInterface |
||
13 | */ |
||
14 | protected $storage; |
||
15 | |||
16 | /** |
||
17 | * @var UserMapper |
||
18 | */ |
||
19 | protected $mapper; |
||
20 | |||
21 | /** |
||
22 | * @var mixed |
||
23 | */ |
||
24 | protected $resolvedIdentity; |
||
25 | |||
26 | public function __construct(UserMapper $mapper) |
||
27 | { |
||
28 | $this->mapper = $mapper; |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * Returns true if and only if storage is empty |
||
33 | * |
||
34 | * @throws \Zend\Authentication\Exception\InvalidArgumentException If it is impossible to determine whether |
||
35 | * storage is empty or not |
||
36 | * @return boolean |
||
37 | */ |
||
38 | public function isEmpty() |
||
51 | |||
52 | /** |
||
53 | * Returns the contents of storage |
||
54 | * |
||
55 | * Behavior is undefined when storage is empty. |
||
56 | * |
||
57 | * @throws \Zend\Authentication\Exception\InvalidArgumentException If reading contents from storage is impossible |
||
58 | * @return mixed |
||
59 | */ |
||
60 | public function read() |
||
80 | |||
81 | /** |
||
82 | * Writes $contents to storage |
||
83 | * |
||
84 | * @param mixed $contents |
||
85 | * @throws \Zend\Authentication\Exception\InvalidArgumentException If writing $contents to storage is impossible |
||
86 | * @return void |
||
87 | */ |
||
88 | public function write($contents) |
||
93 | |||
94 | /** |
||
95 | * Clears contents from storage |
||
96 | * |
||
97 | * @throws \Zend\Authentication\Exception\InvalidArgumentException If clearing contents from storage is impossible |
||
98 | * @return void |
||
99 | */ |
||
100 | public function clear() |
||
105 | |||
106 | /** |
||
107 | * getStorage |
||
108 | * |
||
109 | * @return Storage\StorageInterface |
||
110 | */ |
||
111 | public function getStorage() |
||
118 | |||
119 | /** |
||
120 | * setStorage |
||
121 | * |
||
122 | * @param Storage\StorageInterface $storage |
||
123 | * @access public |
||
124 | * @return Db |
||
125 | */ |
||
126 | public function setStorage(Storage\StorageInterface $storage) |
||
131 | |||
132 | /** |
||
133 | * getMapper |
||
134 | * |
||
135 | * @return UserMapper |
||
136 | */ |
||
137 | public function getMapper() |
||
141 | } |
||
142 |