mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-01 04:23:49 +00:00
Apply rector rules: add annotation for doctrine mapping
This commit is contained in:
@@ -15,13 +15,11 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
|
||||
|
||||
|
||||
#[DiscriminatorMap(typeProperty: 'type', mapping: ['relation' => Relation::class])]
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'chill_person_relations')]
|
||||
class Relation
|
||||
{
|
||||
|
||||
#[Serializer\Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
|
@@ -24,9 +24,6 @@ use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
* @RelationshipNoDuplicate
|
||||
*/
|
||||
#[DiscriminatorMap(typeProperty: 'type', mapping: ['relationship' => Relationship::class])]
|
||||
@@ -38,26 +35,22 @@ class Relationship implements TrackCreationInterface, TrackUpdateInterface
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE)]
|
||||
private ?\DateTimeImmutable $createdAt = null;
|
||||
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: User::class)]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private ?User $createdBy = null;
|
||||
|
||||
|
||||
#[Assert\NotNull]
|
||||
#[Serializer\Groups(['read', 'write'])]
|
||||
#[ORM\ManyToOne(targetEntity: Person::class)]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private ?Person $fromPerson = null;
|
||||
|
||||
|
||||
#[Serializer\Groups(['read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
private ?int $id = null;
|
||||
|
||||
|
||||
#[Assert\NotNull]
|
||||
#[Serializer\Groups(['read', 'write'])]
|
||||
#[ORM\ManyToOne(targetEntity: Relation::class)]
|
||||
@@ -69,7 +62,6 @@ class Relationship implements TrackCreationInterface, TrackUpdateInterface
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
|
||||
private bool $reverse;
|
||||
|
||||
|
||||
#[Assert\NotNull]
|
||||
#[Serializer\Groups(['read', 'write'])]
|
||||
#[ORM\ManyToOne(targetEntity: Person::class)]
|
||||
|
Reference in New Issue
Block a user