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:
@@ -24,81 +24,62 @@ use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
*
|
||||
* @ORM\Table(name="chill_person_relationships")
|
||||
*
|
||||
* @DiscriminatorColumn(name="relation_id", type="integer")
|
||||
*
|
||||
* @RelationshipNoDuplicate
|
||||
*/
|
||||
#[DiscriminatorMap(typeProperty: 'type', mapping: ['relationship' => Relationship::class])]
|
||||
#[ORM\Entity]
|
||||
#[DiscriminatorColumn(name: 'relation_id', type: 'integer')]
|
||||
#[ORM\Table(name: 'chill_person_relationships')]
|
||||
class Relationship implements TrackCreationInterface, TrackUpdateInterface
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="datetime_immutable")
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE)]
|
||||
private ?\DateTimeImmutable $createdAt = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=User::class)
|
||||
*
|
||||
* @ORM\JoinColumn(nullable=false)
|
||||
*/
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: User::class)]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private ?User $createdBy = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Person::class)
|
||||
*
|
||||
* @ORM\JoinColumn(nullable=false)
|
||||
*/
|
||||
|
||||
#[Assert\NotNull]
|
||||
#[Serializer\Groups(['read', 'write'])]
|
||||
#[ORM\ManyToOne(targetEntity: Person::class)]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private ?Person $fromPerson = null;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\GeneratedValue
|
||||
*
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
|
||||
#[Serializer\Groups(['read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Relation::class)
|
||||
*
|
||||
* @ORM\JoinColumn(nullable=false, name="relation_id", referencedColumnName="id")
|
||||
*/
|
||||
|
||||
#[Assert\NotNull]
|
||||
#[Serializer\Groups(['read', 'write'])]
|
||||
#[ORM\ManyToOne(targetEntity: Relation::class)]
|
||||
#[ORM\JoinColumn(nullable: false, name: 'relation_id', referencedColumnName: 'id')]
|
||||
private ?Relation $relation = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean")
|
||||
*/
|
||||
#[Assert\Type(type: 'bool', message: 'This must be of type boolean')]
|
||||
#[Serializer\Groups(['read', 'write'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
|
||||
private bool $reverse;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Person::class)
|
||||
*
|
||||
* @ORM\JoinColumn(nullable=false)
|
||||
*/
|
||||
|
||||
#[Assert\NotNull]
|
||||
#[Serializer\Groups(['read', 'write'])]
|
||||
#[ORM\ManyToOne(targetEntity: Person::class)]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private ?Person $toPerson = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime_immutable", nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true)]
|
||||
private ?\DateTimeImmutable $updatedAt = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=User::class)
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: User::class)]
|
||||
private ?User $updatedBy = null;
|
||||
|
||||
public function getCreatedAt(): ?\DateTimeImmutable
|
||||
|
Reference in New Issue
Block a user