You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Disable the generation of the class hierarchy for this type
47
41
parent: false
@@ -69,13 +63,7 @@ types:
69
63
familyName: ~
70
64
givenName: ~
71
65
additionalName: ~
72
-
gender: ~
73
66
address: ~
74
-
birthDate: ~
75
-
telephone: ~
76
-
email: ~
77
-
url: ~
78
-
jobTitle: ~
79
67
PostalAddress:
80
68
properties:
81
69
# Force the type of the addressCountry property to text
@@ -97,7 +85,6 @@ namespace App\Entity;
97
85
use ApiPlatform\Core\Annotation\ApiProperty;
98
86
use ApiPlatform\Core\Annotation\ApiResource;
99
87
use Doctrine\ORM\Mapping as ORM;
100
-
use Symfony\Component\Validator\Constraints as Assert;
101
88
102
89
/**
103
90
* A person (alive, dead, undead, or fictional).
@@ -118,14 +105,6 @@ class Person
118
105
*/
119
106
private $id;
120
107
121
-
/**
122
-
* @var string|null the name of the item
123
-
*
124
-
* @ORM\Column(type="text", nullable=true)
125
-
* @ApiProperty(iri="http://schema.org/name")
126
-
*/
127
-
private $name;
128
-
129
108
/**
130
109
* @var string|null Family name. In the U.S., the last name of an Person. This can be used along with givenName instead of the name property.
131
110
*
@@ -150,14 +129,6 @@ class Person
150
129
*/
151
130
private $additionalName;
152
131
153
-
/**
154
-
* @var string|null Gender of the person. While http://schema.org/Male and http://schema.org/Female may be used, text strings are also acceptable for people who do not identify as a binary gender.
155
-
*
156
-
* @ORM\Column(type="text", nullable=true)
157
-
* @ApiProperty(iri="http://schema.org/gender")
158
-
*/
159
-
private $gender;
160
-
161
132
/**
162
133
* @var PostalAddress|null physical address of the item
163
134
*
@@ -166,64 +137,11 @@ class Person
166
137
*/
167
138
private $address;
168
139
169
-
/**
170
-
* @var \DateTimeInterface|null date of birth
171
-
*
172
-
* @ORM\Column(type="date", nullable=true)
173
-
* @ApiProperty(iri="http://schema.org/birthDate")
174
-
* @Assert\Date
175
-
*/
176
-
private $birthDate;
177
-
178
-
/**
179
-
* @var string|null the telephone number
180
-
*
181
-
* @ORM\Column(type="text", nullable=true)
182
-
* @ApiProperty(iri="http://schema.org/telephone")
183
-
*/
184
-
private $telephone;
185
-
186
-
/**
187
-
* @var string|null email address
188
-
*
189
-
* @ORM\Column(type="text", nullable=true)
190
-
* @ApiProperty(iri="http://schema.org/email")
191
-
* @Assert\Email
192
-
*/
193
-
private $email;
194
-
195
-
/**
196
-
* @var string|null URL of the item
197
-
*
198
-
* @ORM\Column(type="text", nullable=true)
199
-
* @ApiProperty(iri="http://schema.org/url")
200
-
* @Assert\Url
201
-
*/
202
-
private $url;
203
-
204
-
/**
205
-
* @var string|null the job title of the person (for example, Financial Manager)
206
-
*
207
-
* @ORM\Column(type="text", nullable=true)
208
-
* @ApiProperty(iri="http://schema.org/jobTitle")
209
-
*/
210
-
private $jobTitle;
211
-
212
140
public function getId(): ?int
213
141
{
214
142
return $this->id;
215
143
}
216
144
217
-
public function setName(?string $name): void
218
-
{
219
-
$this->name = $name;
220
-
}
221
-
222
-
public function getName(): ?string
223
-
{
224
-
return $this->name;
225
-
}
226
-
227
145
public function setFamilyName(?string $familyName): void
228
146
{
229
147
$this->familyName = $familyName;
@@ -254,16 +172,6 @@ class Person
254
172
return $this->additionalName;
255
173
}
256
174
257
-
public function setGender(?string $gender): void
258
-
{
259
-
$this->gender = $gender;
260
-
}
261
-
262
-
public function getGender(): ?string
263
-
{
264
-
return $this->gender;
265
-
}
266
-
267
175
public function setAddress(?PostalAddress $address): void
268
176
{
269
177
$this->address = $address;
@@ -273,56 +181,6 @@ class Person
273
181
{
274
182
return $this->address;
275
183
}
276
-
277
-
public function setBirthDate(?\DateTimeInterface $birthDate): void
278
-
{
279
-
$this->birthDate = $birthDate;
280
-
}
281
-
282
-
public function getBirthDate(): ?\DateTimeInterface
283
-
{
284
-
return $this->birthDate;
285
-
}
286
-
287
-
public function setTelephone(?string $telephone): void
288
-
{
289
-
$this->telephone = $telephone;
290
-
}
291
-
292
-
public function getTelephone(): ?string
293
-
{
294
-
return $this->telephone;
295
-
}
296
-
297
-
public function setEmail(?string $email): void
298
-
{
299
-
$this->email = $email;
300
-
}
301
-
302
-
public function getEmail(): ?string
303
-
{
304
-
return $this->email;
305
-
}
306
-
307
-
public function setUrl(?string $url): void
308
-
{
309
-
$this->url = $url;
310
-
}
311
-
312
-
public function getUrl(): ?string
313
-
{
314
-
return $this->url;
315
-
}
316
-
317
-
public function setJobTitle(?string $jobTitle): void
318
-
{
319
-
$this->jobTitle = $jobTitle;
320
-
}
321
-
322
-
public function getJobTitle(): ?string
323
-
{
324
-
return $this->jobTitle;
325
-
}
326
184
}
327
185
```
328
186
@@ -471,6 +329,61 @@ class PostalAddress
471
329
}
472
330
```
473
331
332
+
```php
333
+
<?php
334
+
335
+
declare(strict_types=1);
336
+
337
+
namespace App\Entity;
338
+
339
+
use ApiPlatform\Core\Annotation\ApiProperty;
340
+
use ApiPlatform\Core\Annotation\ApiResource;
341
+
use Doctrine\ORM\Mapping as ORM;
342
+
343
+
/**
344
+
* The most generic type of item.
345
+
*
346
+
* @see http://schema.org/Thing Documentation on Schema.org
347
+
*
348
+
* @ORM\Entity
349
+
* @ApiResource(iri="http://schema.org/Thing")
350
+
*/
351
+
class Thing
352
+
{
353
+
/**
354
+
* @var int|null
355
+
*
356
+
* @ORM\Id
357
+
* @ORM\GeneratedValue(strategy="AUTO")
358
+
* @ORM\Column(type="integer")
359
+
*/
360
+
private $id;
361
+
362
+
/**
363
+
* @var string|null the name of the item
364
+
*
365
+
* @ORM\Column(type="text", nullable=true)
366
+
* @ApiProperty(iri="http://schema.org/name")
367
+
*/
368
+
private $name;
369
+
370
+
public function getId(): ?int
371
+
{
372
+
return $this->id;
373
+
}
374
+
375
+
public function setName(?string $name): void
376
+
{
377
+
$this->name = $name;
378
+
}
379
+
380
+
public function getName(): ?string
381
+
{
382
+
return $this->name;
383
+
}
384
+
}
385
+
```
386
+
474
387
Note that the generator takes care of creating directories corresponding to the namespace structure.
475
388
476
389
Without configuration file, the tool will build the entire Schema.org vocabulary. If no properties are specified for a given
0 commit comments