|
4 | 4 |
|
5 | 5 | namespace RZ\Roadiz\Core\AbstractEntities; |
6 | 6 |
|
7 | | -use ApiPlatform\Doctrine\Orm\Filter\OrderFilter; |
8 | | -use ApiPlatform\Doctrine\Orm\Filter\SearchFilter; |
9 | | -use ApiPlatform\Metadata\ApiFilter; |
10 | 7 | use Doctrine\ORM\Mapping as ORM; |
11 | | -use Symfony\Component\Serializer\Attribute as Serializer; |
| 8 | +use JMS\Serializer\Annotation as Serializer; |
| 9 | +use Symfony\Component\Serializer\Annotation as SymfonySerializer; |
12 | 10 | use Symfony\Component\Validator\Constraints as Assert; |
13 | 11 |
|
14 | 12 | /** |
|
19 | 17 | #[ORM\MappedSuperclass, |
20 | 18 | ORM\Table, |
21 | 19 | ORM\HasLifecycleCallbacks] |
22 | | -abstract class AbstractHuman implements DateTimedInterface, PersistableInterface |
| 20 | +abstract class AbstractHuman extends AbstractDateTimed |
23 | 21 | { |
24 | | - use SequentialIdTrait; |
25 | | - use DateTimedTrait; |
26 | | - |
27 | | - #[ORM\Column(type: 'string', length: 200, unique: true, nullable: false)] |
28 | | - #[Serializer\Groups(['user_personal', 'human'])] |
29 | | - #[Assert\NotNull] |
30 | | - #[Assert\NotBlank] |
31 | | - #[Assert\Length(max: 200)] |
32 | | - #[Assert\Email] |
33 | | - #[ApiFilter(OrderFilter::class)] |
34 | | - #[ApiFilter(SearchFilter::class)] |
35 | | - // @phpstan-ignore-next-line |
| 22 | + #[ORM\Column(type: 'string', length: 200, unique: true), |
| 23 | + Serializer\Groups(['user_personal', 'human']), |
| 24 | + SymfonySerializer\Groups(['user_personal', 'human']), |
| 25 | + Assert\NotNull(), |
| 26 | + Assert\NotBlank(), |
| 27 | + Assert\Length(max: 200), |
| 28 | + Assert\Email()] |
36 | 29 | protected ?string $email = null; |
37 | 30 |
|
38 | 31 | /** |
39 | 32 | * Public name (pseudonyme) that can be displayed to a public audience. |
40 | 33 | */ |
41 | 34 | #[ORM\Column(name: 'publicName', type: 'string', length: 250, nullable: true), |
42 | 35 | Serializer\Groups(['user_public', 'human']), |
| 36 | + SymfonySerializer\Groups(['user_public', 'human']), |
43 | 37 | Assert\Length(max: 250)] |
44 | 38 | protected ?string $publicName = null; |
45 | 39 |
|
46 | 40 | #[ORM\Column(name: 'firstName', type: 'string', length: 250, nullable: true), |
47 | 41 | Serializer\Groups(['user_personal', 'human']), |
| 42 | + SymfonySerializer\Groups(['user_personal', 'human']), |
48 | 43 | Assert\Length(max: 250)] |
49 | 44 | protected ?string $firstName = null; |
50 | 45 |
|
51 | 46 | #[ORM\Column(name: 'lastName', type: 'string', length: 250, nullable: true), |
52 | 47 | Serializer\Groups(['user_personal', 'human']), |
| 48 | + SymfonySerializer\Groups(['user_personal', 'human']), |
53 | 49 | Assert\Length(max: 250)] |
54 | 50 | protected ?string $lastName = null; |
55 | 51 |
|
56 | 52 | #[ORM\Column(type: 'string', length: 250, nullable: true), |
57 | 53 | Serializer\Groups(['user_personal', 'human']), |
| 54 | + SymfonySerializer\Groups(['user_personal', 'human']), |
58 | 55 | Assert\Length(max: 250)] |
59 | 56 | protected ?string $company = null; |
60 | 57 |
|
|
0 commit comments