1 | <?php |
||
5 | abstract class AbstractResponder implements ResponderInterface |
||
6 | { |
||
7 | const OBJECT_IDENTIFIER = null; |
||
8 | |||
9 | /** |
||
10 | * @var array validOptions - container holding valid options for the responseObject |
||
11 | */ |
||
12 | private $validOptions = array(); |
||
13 | |||
14 | /** |
||
15 | * @var array |
||
16 | */ |
||
17 | private $options = array(); |
||
18 | |||
19 | /** |
||
20 | * Sets value to the option of the operation |
||
21 | * |
||
22 | * @var string $option |
||
23 | * @var string $value |
||
24 | * @return ResponderInterface |
||
25 | */ |
||
26 | public function setOption($option, $value) |
||
34 | |||
35 | /** |
||
36 | * Sets values to the options of the operation |
||
37 | * |
||
38 | * @var array $option |
||
39 | * @return ResponderInterface |
||
40 | */ |
||
41 | public function setOptions(array $options) |
||
51 | |||
52 | /** |
||
53 | * Gets all options of the operation |
||
54 | * |
||
55 | * @return array |
||
56 | */ |
||
57 | public function getOptions() |
||
61 | |||
62 | /** |
||
63 | * Gets value from options |
||
64 | * |
||
65 | * @var string $option |
||
66 | * @return string value |
||
67 | * @throws \Exception |
||
68 | */ |
||
69 | public function getOption($option) |
||
77 | |||
78 | /** |
||
79 | * Validates a option comparing it to the registered options of the responseobject |
||
80 | * |
||
81 | * @var array $option |
||
82 | * @return bool |
||
83 | * @throws \Exception |
||
84 | */ |
||
85 | private function isValidOption($option) |
||
93 | |||
94 | /** |
||
95 | * registers an option from the response object |
||
96 | * |
||
97 | * @var array $option |
||
98 | * @return ResponderInterface |
||
99 | */ |
||
100 | protected function registerOption($option) |
||
108 | |||
109 | |||
110 | /** |
||
111 | * Render the operation item |
||
112 | * @return string operation item |
||
113 | * @throws \Exception |
||
114 | */ |
||
115 | public function render() |
||
128 | } |
||
129 |