1 | <?php |
||
21 | class UserContext implements \IteratorAggregate |
||
22 | { |
||
23 | private $parameters = []; |
||
24 | |||
25 | /** |
||
26 | * Set a parameter for this context. |
||
27 | * |
||
28 | * @param string $key Parameter identifier |
||
29 | * @param mixed $value Parameter value (it should be serializable) |
||
30 | */ |
||
31 | public function addParameter($key, $value) |
||
35 | |||
36 | /** |
||
37 | * Set all the parameters of this context. |
||
38 | * |
||
39 | * @param array $parameters |
||
40 | */ |
||
41 | public function setParameters(array $parameters) |
||
45 | |||
46 | /** |
||
47 | * Determine whether a parameter exists. |
||
48 | * |
||
49 | * @param string $key |
||
50 | * |
||
51 | * @return bool |
||
52 | */ |
||
53 | public function hasParameter($key) |
||
57 | |||
58 | /** |
||
59 | * Return all parameters of this context. |
||
60 | * |
||
61 | * @return array |
||
62 | */ |
||
63 | public function getParameters() |
||
67 | |||
68 | public function getIterator() |
||
72 | } |
||
73 |