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 | * ApiProperty annotation. |
||
20 | * |
||
21 | * @author Kévin Dunglas <[email protected]> |
||
22 | * |
||
23 | * @Annotation |
||
24 | * @Target({"METHOD", "PROPERTY"}) |
||
25 | * @Attributes( |
||
26 | * @Attribute("deprecationReason", type="string"), |
||
27 | * @Attribute("fetchable", type="bool"), |
||
28 | * @Attribute("fetchEager", type="bool"), |
||
29 | * @Attribute("openapiContext", type="array"), |
||
30 | * @Attribute("jsonldContext", type="array"), |
||
31 | * @Attribute("push", type="bool"), |
||
32 | * @Attribute("swaggerContext", type="array") |
||
33 | * ) |
||
34 | */ |
||
35 | final class ApiProperty |
||
36 | { |
||
37 | use AttributesHydratorTrait; |
||
38 | |||
39 | /** |
||
40 | * @var string |
||
41 | */ |
||
42 | public $description; |
||
43 | |||
44 | /** |
||
45 | * @var bool |
||
46 | */ |
||
47 | public $readable; |
||
48 | |||
49 | /** |
||
50 | * @var bool |
||
51 | */ |
||
52 | public $writable; |
||
53 | |||
54 | /** |
||
55 | * @var bool |
||
56 | */ |
||
57 | public $readableLink; |
||
58 | |||
59 | /** |
||
60 | * @var bool |
||
61 | */ |
||
62 | public $writableLink; |
||
63 | |||
64 | /** |
||
65 | * @var bool |
||
66 | */ |
||
67 | public $required; |
||
68 | |||
69 | /** |
||
70 | * @var string |
||
71 | */ |
||
72 | public $iri; |
||
73 | |||
74 | /** |
||
75 | * @var bool |
||
76 | */ |
||
77 | public $identifier; |
||
78 | |||
79 | /** |
||
80 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
81 | * |
||
82 | * @var string |
||
83 | */ |
||
84 | private $deprecationReason; |
||
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
85 | |||
86 | /** |
||
87 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
88 | * |
||
89 | * @var bool |
||
90 | */ |
||
91 | private $fetchable; |
||
0 ignored issues
–
show
|
|||
92 | |||
93 | /** |
||
94 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
95 | * |
||
96 | * @var bool |
||
97 | */ |
||
98 | private $fetchEager; |
||
0 ignored issues
–
show
|
|||
99 | |||
100 | /** |
||
101 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
102 | * |
||
103 | * @var array |
||
104 | */ |
||
105 | private $jsonldContext; |
||
0 ignored issues
–
show
|
|||
106 | |||
107 | /** |
||
108 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
109 | * |
||
110 | * @var array |
||
111 | */ |
||
112 | private $openapiContext; |
||
0 ignored issues
–
show
|
|||
113 | |||
114 | /** |
||
115 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
116 | * |
||
117 | * @var bool |
||
118 | */ |
||
119 | private $push; |
||
0 ignored issues
–
show
|
|||
120 | |||
121 | /** |
||
122 | * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112 |
||
123 | * |
||
124 | * @var array |
||
125 | */ |
||
126 | private $swaggerContext; |
||
0 ignored issues
–
show
|
|||
127 | |||
128 | /** |
||
129 | * @throws InvalidArgumentException |
||
130 | */ |
||
131 | public function __construct(array $values = []) |
||
132 | { |
||
133 | $this->hydrateAttributes($values); |
||
134 | } |
||
135 | } |
||
136 |