1 | <?php |
||
2 | |||
3 | /* |
||
4 | * This file is part of the API Platform project. |
||
5 | * |
||
6 | * (c) Kévin Dunglas <[email protected]> |
||
7 | * |
||
8 | * For the full copyright and license information, please view the LICENSE |
||
9 | * file that was distributed with this source code. |
||
10 | */ |
||
11 | |||
12 | declare(strict_types=1); |
||
13 | |||
14 | namespace ApiPlatform\Core\Annotation; |
||
15 | |||
16 | use ApiPlatform\Core\Exception\InvalidArgumentException; |
||
17 | |||
18 | /** |
||
19 | * ApiResource annotation. |
||
20 | * |
||
21 | * @author Kévin Dunglas <[email protected]> |
||
22 | * |
||
23 | * @Annotation |
||
24 | * @Target({"CLASS"}) |
||
25 | * @Attributes( |
||
26 | * @Attribute("accessControl", type="string"), |
||
27 | * @Attribute("accessControlMessage", type="string"), |
||
28 | * @Attribute("security", type="string"), |
||
29 | * @Attribute("securityMessage", type="string"), |
||
30 | * @Attribute("securityPostDenormalize", type="string"), |
||
31 | * @Attribute("securityPostDenormalizeMessage", type="string"), |
||
32 | * @Attribute("attributes", type="array"), |
||
33 | * @Attribute("cacheHeaders", type="array"), |
||
34 | * @Attribute("collectionOperations", type="array"), |
||
35 | * @Attribute("denormalizationContext", type="array"), |
||
36 | * @Attribute("deprecationReason", type="string"), |
||
37 | * @Attribute("description", type="string"), |
||
38 | * @Attribute("elasticsearch", type="bool"), |
||
39 | * @Attribute("fetchPartial", type="bool"), |
||
40 | * @Attribute("forceEager", type="bool"), |
||
41 | * @Attribute("formats", type="array"), |
||
42 | * @Attribute("filters", type="string[]"), |
||
43 | * @Attribute("graphql", type="array"), |
||
44 | * @Attribute("hydraContext", type="array"), |
||
45 | * @Attribute("input", type="mixed"), |
||
46 | * @Attribute("iri", type="string"), |
||
47 | * @Attribute("itemOperations", type="array"), |
||
48 | * @Attribute("maximumItemsPerPage", type="int"), |
||
49 | * @Attribute("mercure", type="mixed"), |
||
50 | * @Attribute("messenger", type="mixed"), |
||
51 | * @Attribute("normalizationContext", type="array"), |
||
52 | * @Attribute("openapiContext", type="array"), |
||
53 | * @Attribute("order", type="array"), |
||
54 | * @Attribute("output", type="mixed"), |
||
55 | * @Attribute("paginationClientEnabled", type="bool"), |
||
56 | * @Attribute("paginationClientItemsPerPage", type="bool"), |
||
57 | * @Attribute("paginationClientPartial", type="bool"), |
||
58 | * @Attribute("paginationEnabled", type="bool"), |
||
59 | * @Attribute("paginationFetchJoinCollection", type="bool"), |
||
60 | * @Attribute("paginationItemsPerPage", type="int"), |
||
61 | * @Attribute("paginationPartial", type="bool"), |
||
62 | * @Attribute("paginationViaCursor", type="array"), |
||
63 | * @Attribute("routePrefix", type="string"), |
||
64 | * @Attribute("shortName", type="string"), |
||
65 | * @Attribute("subresourceOperations", type="array"), |
||
66 | * @Attribute("sunset", type="string"), |
||
67 | * @Attribute("swaggerContext", type="array"), |
||
68 | * @Attribute("validationGroups", type="mixed") |
||
69 | * ) |
||
70 | */ |
||
71 | final class ApiResource |
||
72 | { |
||
73 | use AttributesHydratorTrait; |
||
74 | |||
75 | /** |
||
76 | * @var string |
||
77 | */ |
||
78 | public $shortName; |
||
79 | |||
80 | /** |
||
81 | * @var string |
||
82 | */ |
||
83 | public $description; |
||
84 | |||
85 | /** |
||
86 | * @var string |
||
87 | */ |
||
88 | public $iri; |
||
89 | |||
90 | /** |
||
91 | * @var array |
||
92 | */ |
||
93 | public $itemOperations; |
||
94 | |||
95 | /** |
||
96 | * @var array |
||
97 | */ |
||
98 | public $collectionOperations; |
||
99 | |||
100 | /** |
||
101 | * @var array |
||
102 | */ |
||
103 | public $subresourceOperations; |
||
104 | |||
105 | /** |
||
106 | * @var array |
||
107 | */ |
||
108 | public $graphql; |
||
109 | |||
110 | /** |
||
111 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
112 | * |
||
113 | * @var string |
||
114 | */ |
||
115 | private $security; |
||
116 | |||
117 | /** |
||
118 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
119 | * |
||
120 | * @var string |
||
121 | */ |
||
122 | private $securityMessage; |
||
123 | |||
124 | /** |
||
125 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
126 | * |
||
127 | * @var string |
||
128 | */ |
||
129 | private $securityPostDenormalize; |
||
130 | |||
131 | /** |
||
132 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
133 | * |
||
134 | * @var string |
||
135 | */ |
||
136 | private $securityPostDenormalizeMessage; |
||
137 | |||
138 | /** |
||
139 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
140 | * |
||
141 | * @var array |
||
142 | */ |
||
143 | private $cacheHeaders; |
||
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
144 | |||
145 | /** |
||
146 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
147 | * |
||
148 | * @var array |
||
149 | */ |
||
150 | private $denormalizationContext; |
||
151 | |||
152 | /** |
||
153 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
154 | * |
||
155 | * @var string |
||
156 | */ |
||
157 | private $deprecationReason; |
||
158 | |||
159 | /** |
||
160 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
161 | * |
||
162 | * @var bool |
||
163 | */ |
||
164 | private $elasticsearch; |
||
165 | |||
166 | /** |
||
167 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
168 | * |
||
169 | * @var bool |
||
170 | */ |
||
171 | private $fetchPartial; |
||
172 | |||
173 | /** |
||
174 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
175 | * |
||
176 | * @var bool |
||
177 | */ |
||
178 | private $forceEager; |
||
179 | |||
180 | /** |
||
181 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
182 | * |
||
183 | * @var array |
||
184 | */ |
||
185 | private $formats; |
||
186 | |||
187 | /** |
||
188 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
189 | * |
||
190 | * @var string[] |
||
191 | */ |
||
192 | private $filters; |
||
193 | |||
194 | /** |
||
195 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
196 | * |
||
197 | * @var string[] |
||
198 | */ |
||
199 | private $hydraContext; |
||
200 | |||
201 | /** |
||
202 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
203 | * |
||
204 | * @var int |
||
205 | */ |
||
206 | private $maximumItemsPerPage; |
||
207 | |||
208 | /** |
||
209 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
210 | * |
||
211 | * @var mixed |
||
212 | */ |
||
213 | private $mercure; |
||
214 | |||
215 | /** |
||
216 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
217 | * |
||
218 | * @var bool|string |
||
219 | */ |
||
220 | private $messenger; |
||
221 | |||
222 | /** |
||
223 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
224 | * |
||
225 | * @var array |
||
226 | */ |
||
227 | private $normalizationContext; |
||
228 | |||
229 | /** |
||
230 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
231 | * |
||
232 | * @var array |
||
233 | */ |
||
234 | private $order; |
||
235 | |||
236 | /** |
||
237 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
238 | * |
||
239 | * @var bool |
||
240 | */ |
||
241 | private $paginationClientEnabled; |
||
242 | |||
243 | /** |
||
244 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
245 | * |
||
246 | * @var bool |
||
247 | */ |
||
248 | private $paginationClientItemsPerPage; |
||
249 | |||
250 | /** |
||
251 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
252 | * |
||
253 | * @var bool |
||
254 | */ |
||
255 | private $paginationClientPartial; |
||
256 | |||
257 | /** |
||
258 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
259 | * |
||
260 | * @var bool |
||
261 | */ |
||
262 | private $paginationEnabled; |
||
263 | |||
264 | /** |
||
265 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
266 | * |
||
267 | * @var bool |
||
268 | */ |
||
269 | private $paginationFetchJoinCollection; |
||
270 | |||
271 | /** |
||
272 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
273 | * |
||
274 | * @var int |
||
275 | */ |
||
276 | private $paginationItemsPerPage; |
||
277 | |||
278 | /** |
||
279 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
280 | * |
||
281 | * @var int |
||
282 | */ |
||
283 | private $paginationPartial; |
||
284 | |||
285 | /** |
||
286 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
287 | * |
||
288 | * @var string |
||
289 | */ |
||
290 | private $routePrefix; |
||
291 | |||
292 | /** |
||
293 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
294 | * |
||
295 | * @var array |
||
296 | */ |
||
297 | private $swaggerContext; |
||
298 | |||
299 | /** |
||
300 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
301 | * |
||
302 | * @var mixed |
||
303 | */ |
||
304 | private $validationGroups; |
||
305 | |||
306 | /** |
||
307 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
308 | * |
||
309 | * @var string |
||
310 | */ |
||
311 | private $sunset; |
||
312 | |||
313 | /** |
||
314 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
315 | * |
||
316 | * @var string|false |
||
317 | */ |
||
318 | private $input; |
||
319 | |||
320 | /** |
||
321 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
322 | * |
||
323 | * @var string|false |
||
324 | */ |
||
325 | private $output; |
||
326 | |||
327 | /** |
||
328 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
329 | * |
||
330 | * @var array |
||
331 | */ |
||
332 | private $openapiContext; |
||
333 | |||
334 | /** |
||
335 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
336 | * |
||
337 | * @var array |
||
338 | */ |
||
339 | private $paginationViaCursor; |
||
340 | |||
341 | /** |
||
342 | * @throws InvalidArgumentException |
||
343 | */ |
||
344 | public function __construct(array $values = []) |
||
345 | { |
||
346 | $this->hydrateAttributes($values); |
||
347 | } |
||
348 | } |
||
349 |