|
9 | 9 | use Doctrine\ORM\Mapping as ORM; |
10 | 10 | use Money\Currency; |
11 | 11 |
|
12 | | -/** |
13 | | - * @AssoConnectAssert\Entity() |
14 | | - * @ORM\Entity() |
15 | | - */ |
| 12 | +#[ |
| 13 | + AssoConnectAssert\Entity, |
| 14 | + ORM\Entity, |
| 15 | +] |
16 | 16 | class MyEntity |
17 | 17 | { |
18 | | - /** |
19 | | - * @ORM\Id |
20 | | - * @ORM\Column(type="integer") |
21 | | - * @ORM\GeneratedValue(strategy="NONE") |
22 | | - */ |
| 18 | + #[ |
| 19 | + ORM\Id, |
| 20 | + ORM\Column(type: 'integer'), |
| 21 | + ORM\GeneratedValue(strategy: 'NONE'), |
| 22 | + ] |
23 | 23 | public int $id; |
24 | 24 |
|
25 | 25 | /** |
26 | | - * @ORM\Column(type="array") |
27 | 26 | * @var array<mixed> |
28 | 27 | */ |
| 28 | + #[ORM\Column(type: 'array')] |
29 | 29 | public array $array; |
30 | 30 |
|
31 | | - /** |
32 | | - * @ORM\Column(type="bic") |
33 | | - */ |
| 31 | + #[ORM\Column(type: 'bic')] |
34 | 32 | public string $bic; |
35 | 33 |
|
36 | | - /** |
37 | | - * @ORM\Column(type="bigint") |
38 | | - */ |
| 34 | + #[ORM\Column(type: 'bigint')] |
39 | 35 | public int $bigint; |
40 | 36 |
|
41 | | - /** |
42 | | - * @ORM\Column(type="bigint", options={"unsigned"=true}) |
43 | | - */ |
| 37 | + #[ORM\Column(type: 'bigint', options: ['unsigned' => true])] |
44 | 38 | public int $bigintUnsigned; |
45 | 39 |
|
46 | | - /** |
47 | | - * @ORM\Column(type="boolean") |
48 | | - */ |
| 40 | + #[ORM\Column(type: 'boolean')] |
49 | 41 | public bool $boolean; |
50 | 42 |
|
51 | | - /** |
52 | | - * @ORM\Column(type="country") |
53 | | - */ |
| 43 | + #[ORM\Column(type: 'country')] |
54 | 44 | public string $country; |
55 | 45 |
|
56 | | - /** |
57 | | - * @ORM\Column(type="currency") |
58 | | - */ |
| 46 | + #[ORM\Column(type: 'currency')] |
59 | 47 | public Currency $currency; |
60 | 48 |
|
61 | | - /** |
62 | | - * @ORM\Column(type="date") |
63 | | - */ |
| 49 | + #[ORM\Column(type: 'date')] |
64 | 50 | public \DateTime $date; |
65 | 51 |
|
66 | | - /** |
67 | | - * @ORM\Column(type="datetime") |
68 | | - */ |
| 52 | + #[ORM\Column(type: 'datetime')] |
69 | 53 | public \DateTime $datetime; |
70 | 54 |
|
71 | | - /** |
72 | | - * @ORM\Column(type="decimal", precision=5, scale=3) |
73 | | - */ |
| 55 | + #[ORM\Column(type: 'decimal', precision: 5, scale: 3)] |
74 | 56 | public float $decimal; |
75 | 57 |
|
76 | | - /** |
77 | | - * @ORM\Column(type="email") |
78 | | - */ |
| 58 | + #[ORM\Column(type: 'email')] |
79 | 59 | public string $email; |
80 | 60 |
|
81 | | - /** |
82 | | - * @ORM\Column(type="float") |
83 | | - */ |
| 61 | + #[ORM\Column(type: 'float')] |
84 | 62 | public float $float; |
85 | 63 |
|
86 | | - /** |
87 | | - * @ORM\Column(type="iban") |
88 | | - */ |
| 64 | + #[ORM\Column(type: 'iban')] |
89 | 65 | public string $iban; |
90 | 66 |
|
91 | | - /** |
92 | | - * @ORM\Column(type="integer") |
93 | | - */ |
| 67 | + #[ORM\Column(type: 'integer')] |
94 | 68 | public int $integer; |
95 | 69 |
|
96 | | - /** |
97 | | - * @ORM\Column(type="ip") |
98 | | - */ |
| 70 | + #[ORM\Column(type: 'ip')] |
99 | 71 | public string $ip; |
100 | 72 |
|
101 | | - /** |
102 | | - * @ORM\Column(type="json") |
103 | | - */ |
| 73 | + #[ORM\Column(type: 'json')] |
104 | 74 | public string $json; |
105 | 75 |
|
106 | | - /** |
107 | | - * @ORM\Column(type="latitude") |
108 | | - */ |
| 76 | + #[ORM\Column(type: 'latitude')] |
109 | 77 | public string $latitude; |
110 | 78 |
|
111 | | - /** |
112 | | - * @ORM\Column(type="locale") |
113 | | - */ |
| 79 | + #[ORM\Column(type: 'locale')] |
114 | 80 | public string $locale; |
115 | 81 |
|
116 | | - /** |
117 | | - * @ORM\Column(type="longitude") |
118 | | - */ |
| 82 | + #[ORM\Column(type: 'longitude')] |
119 | 83 | public string $longitude; |
120 | 84 |
|
121 | | - /** |
122 | | - * @ORM\Column(type="money") |
123 | | - */ |
| 85 | + #[ORM\Column(type: 'money')] |
124 | 86 | public float $money; |
125 | 87 |
|
126 | | - /** |
127 | | - * @ORM\Column(type="string", nullable=false) |
128 | | - */ |
| 88 | + #[ORM\Column(type: 'string', nullable: false)] |
129 | 89 | public string $notNullable; |
130 | 90 |
|
131 | | - /** |
132 | | - * @ORM\Column(type="percent") |
133 | | - */ |
| 91 | + #[ORM\Column(type: 'percent')] |
134 | 92 | public float $percent; |
135 | 93 |
|
136 | | - /** |
137 | | - * @ORM\Column(type="phone") |
138 | | - */ |
| 94 | + #[ORM\Column(type: 'phone')] |
139 | 95 | public string $phone; |
140 | 96 |
|
141 | | - /** |
142 | | - * @ORM\Column(type="phonelandline") |
143 | | - */ |
| 97 | + #[ORM\Column(type: 'phonelandline')] |
144 | 98 | public string $phonelandline; |
145 | 99 |
|
146 | | - /** |
147 | | - * @ORM\Column(type="phonemobile") |
148 | | - */ |
| 100 | + #[ORM\Column(type: 'phonemobile')] |
149 | 101 | public string $phonemobile; |
150 | 102 |
|
151 | | - /** |
152 | | - * @ORM\Column(type="smallint") |
153 | | - */ |
| 103 | + #[ORM\Column(type: 'smallint')] |
154 | 104 | public int $smallint; |
155 | 105 |
|
156 | | - /** |
157 | | - * @ORM\Column(type="smallint", options={"unsigned"=true}) |
158 | | - */ |
| 106 | + #[ORM\Column(type: 'smallint', options: ['unsigned' => true])] |
159 | 107 | public int $smallintUnsigned; |
160 | 108 |
|
161 | | - /** |
162 | | - * @ORM\Column(type="string", length=10) |
163 | | - */ |
| 109 | + #[ORM\Column(type: 'string', length: 10)] |
164 | 110 | public string $string; |
165 | 111 |
|
166 | | - /** |
167 | | - * @ORM\Column(type="text", length=10) |
168 | | - */ |
| 112 | + #[ORM\Column(type: 'text', length: 10)] |
169 | 113 | public string $text; |
170 | 114 |
|
171 | | - /** |
172 | | - * @ORM\Column(type="timezone") |
173 | | - */ |
| 115 | + #[ORM\Column(type: 'timezone')] |
174 | 116 | public string $timezone; |
175 | 117 |
|
176 | | - /** |
177 | | - * @ORM\Column(type="uuid") |
178 | | - */ |
| 118 | + #[ORM\Column(type: 'uuid')] |
179 | 119 | public string $uuid; |
180 | 120 |
|
181 | | - /** |
182 | | - * @ORM\Column(type="uuid_binary_ordered_time") |
183 | | - */ |
| 121 | + #[ORM\Column(type: 'uuid_binary_ordered_time')] |
184 | 122 | public string $uuid_binary_ordered_time; |
185 | 123 |
|
186 | 124 | /** |
187 | 125 | * ASSOCIATIONS |
188 | 126 | */ |
189 | 127 |
|
190 | | - /** |
191 | | - * @ORM\ManyToOne(targetEntity="MyEntityParent") |
192 | | - */ |
| 128 | + #[ORM\ManyToOne(targetEntity: MyEntityParent::class)] |
193 | 129 | public ?MyEntityParent $parentNullable; |
194 | 130 |
|
195 | | - /** |
196 | | - * @ORM\ManyToOne(targetEntity="MyEntityParent") |
197 | | - * @ORM\JoinColumn(nullable=false) |
198 | | - */ |
| 131 | + #[ |
| 132 | + ORM\ManyToOne(targetEntity: MyEntityParent::class), |
| 133 | + ORM\JoinColumn(nullable: false) |
| 134 | + ] |
199 | 135 | public MyEntityParent $parentNotNullable; |
200 | 136 |
|
201 | | - /** |
202 | | - * @ORM\OneToMany(targetEntity="MyEntityParent", mappedBy="mainChild") |
203 | | - */ |
| 137 | + #[ORM\OneToMany(targetEntity: MyEntityParent::class, mappedBy: 'mainChild')] |
204 | 138 | public MyEntityParent $mainParent; |
205 | 139 |
|
206 | 140 | /** |
207 | | - * @ORM\ManyToMany(targetEntity="MyEntityParent") |
208 | | - * @var array<MyEntityParent> |
| 141 | + * @var array<MyEntityParent> $parents |
209 | 142 | */ |
| 143 | + #[ORM\ManyToMany(targetEntity: MyEntityParent::class)] |
210 | 144 | public array $parents; |
211 | 145 |
|
212 | 146 | /** |
213 | 147 | * EMBEDDABLES |
214 | 148 | */ |
215 | 149 |
|
216 | | - /** |
217 | | - * @ORM\Embedded(class="MyEmbeddable") |
218 | | - */ |
| 150 | + #[ORM\Embedded(class: 'MyEmbeddable')] |
219 | 151 | public MyEmbeddable $embeddable; |
220 | 152 |
|
221 | | - /** |
222 | | - * @ORM\Column(type="date_absolute") |
223 | | - */ |
| 153 | + #[ORM\Column(type: 'date_absolute')] |
224 | 154 | public AbsoluteDate $absoluteDate; |
225 | 155 |
|
226 | | - /** |
227 | | - * @ORM\Column(type="frenchRna") |
228 | | - */ |
| 156 | + #[ORM\Column(type: 'frenchRna')] |
229 | 157 | public string $frenchRNA; |
230 | 158 |
|
231 | | - /** |
232 | | - * @ORM\Column(type="frenchSiren") |
233 | | - */ |
| 159 | + #[ORM\Column(type: 'frenchSiren')] |
234 | 160 | public string $frenchSIREN; |
235 | 161 | } |
0 commit comments