1 | <?php |
||
14 | abstract class ApiRouteSpec extends Nette\Object |
||
15 | { |
||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $description; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | protected $path = '/'; |
||
26 | |||
27 | /** |
||
28 | * @Enum({"CREATE", "READ", "UPDATE", "DELETE", "OPTIONS"}) |
||
29 | * @var string |
||
30 | */ |
||
31 | protected $method; |
||
32 | |||
33 | /** |
||
34 | * @var array |
||
35 | */ |
||
36 | protected $parameters = []; |
||
37 | |||
38 | /** |
||
39 | * @var array |
||
40 | */ |
||
41 | protected $parameters_infos = ['requirement', 'type', 'description', 'default']; |
||
42 | |||
43 | /** |
||
44 | * @var int |
||
45 | */ |
||
46 | protected $priority = 0; |
||
47 | |||
48 | /** |
||
49 | * @Enum({"json", "xml"}) |
||
50 | * @var string |
||
51 | */ |
||
52 | protected $format; |
||
53 | |||
54 | /** |
||
55 | * @var mixed |
||
56 | */ |
||
57 | protected $example; |
||
58 | |||
59 | /** |
||
60 | * @var string |
||
61 | */ |
||
62 | protected $section; |
||
63 | |||
64 | /** |
||
65 | * @var array |
||
66 | */ |
||
67 | protected $tags = []; |
||
68 | |||
69 | /** |
||
70 | * @var array |
||
71 | */ |
||
72 | protected $response_codes = []; |
||
73 | |||
74 | /** |
||
75 | * @Enum({TRUE, FALSE}) |
||
76 | * @var bool |
||
77 | */ |
||
78 | protected $disable = FALSE; |
||
79 | |||
80 | |||
81 | /** |
||
82 | * @param array $data |
||
83 | */ |
||
84 | public function __construct(array $data) |
||
98 | |||
99 | |||
100 | /** |
||
101 | * @param string $description |
||
102 | * @return void |
||
103 | */ |
||
104 | public function setDescription($description) |
||
108 | |||
109 | |||
110 | /** |
||
111 | * @return string |
||
112 | */ |
||
113 | public function getDescription() |
||
117 | |||
118 | |||
119 | /** |
||
120 | * @param string $path |
||
121 | * @return void |
||
122 | */ |
||
123 | protected function setPath($path) |
||
131 | |||
132 | |||
133 | /** |
||
134 | * @return string |
||
135 | */ |
||
136 | public function getPath() |
||
140 | |||
141 | |||
142 | /** |
||
143 | * @param string $method |
||
144 | * @return void |
||
145 | */ |
||
146 | protected function setMethod($method) |
||
150 | |||
151 | |||
152 | /** |
||
153 | * @return string |
||
154 | */ |
||
155 | public function getMethod() |
||
159 | |||
160 | |||
161 | /** |
||
162 | * @param array $parameters |
||
163 | */ |
||
164 | protected function setParameters(array $parameters) |
||
190 | |||
191 | |||
192 | /** |
||
193 | * @return array |
||
194 | */ |
||
195 | public function getParameters() |
||
199 | |||
200 | |||
201 | /** |
||
202 | * @param int $priority |
||
203 | * @return void |
||
204 | */ |
||
205 | public function setPriority($priority) |
||
209 | |||
210 | |||
211 | /** |
||
212 | * @return int |
||
213 | */ |
||
214 | public function getPriority() |
||
218 | |||
219 | |||
220 | /** |
||
221 | * @param string $format |
||
222 | * @return void |
||
223 | */ |
||
224 | public function setFormat($format) |
||
228 | |||
229 | |||
230 | /** |
||
231 | * @return string |
||
232 | */ |
||
233 | public function getFormat() |
||
237 | |||
238 | |||
239 | /** |
||
240 | * @param mixed $example |
||
241 | * @return void |
||
242 | */ |
||
243 | public function setExample($example) |
||
247 | |||
248 | |||
249 | /** |
||
250 | * @return mixed |
||
251 | */ |
||
252 | public function getExample() |
||
256 | |||
257 | |||
258 | /** |
||
259 | * @param string $section |
||
260 | * @return void |
||
261 | */ |
||
262 | public function setSection($section) |
||
266 | |||
267 | |||
268 | /** |
||
269 | * @return string |
||
270 | */ |
||
271 | public function getSection() |
||
275 | |||
276 | |||
277 | /** |
||
278 | * @param array $tags |
||
279 | * @return void |
||
280 | */ |
||
281 | public function setTags(array $tags) |
||
285 | |||
286 | |||
287 | /** |
||
288 | * @return array |
||
289 | */ |
||
290 | public function getTags() |
||
307 | |||
308 | |||
309 | /** |
||
310 | * @param array $response_codes |
||
311 | * @return void |
||
312 | */ |
||
313 | public function setResponseCodes(array $response_codes) |
||
317 | |||
318 | |||
319 | /** |
||
320 | * @return array |
||
321 | */ |
||
322 | public function getResponseCodes() |
||
326 | |||
327 | |||
328 | /** |
||
329 | * @param bool $disable |
||
330 | */ |
||
331 | public function setDisable($disable) |
||
335 | |||
336 | |||
337 | /** |
||
338 | * @return bool |
||
339 | */ |
||
340 | public function getDisable() |
||
344 | |||
345 | } |
||
346 | |||
347 |