src/Entity/RgpdContact.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\RgpdContactRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassRgpdContactRepository::class)]
  6. class RgpdContact
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column(type'integer')]
  11.     private $id;
  12.     #[ORM\Column(type'string'length255)]
  13.     private $name;
  14.     #[ORM\Column(type'string'length20)]
  15.     private $phone;
  16.     #[ORM\Column(type'string'length255)]
  17.     private $email;
  18.     #[ORM\Column(type'datetime',options:['default'=> 'CURRENT_TIMESTAMP'])]
  19.     private $createdAt;
  20.     #[ORM\Column(type'datetime',options:['default'=> 'CURRENT_TIMESTAMP'])]
  21.     private $updatedAt;
  22.     #[ORM\ManyToOne(targetEntityAccountingFirm::class, inversedBy'rgpdContacts')]
  23.     #[ORM\JoinColumn(nullablefalse)]
  24.     private $AccountingFirm;
  25.     public function getId(): ?int
  26.     {
  27.         return $this->id;
  28.     }
  29.     public function getName(): ?string
  30.     {
  31.         return $this->name;
  32.     }
  33.     public function setName(string $name): self
  34.     {
  35.         $this->name $name;
  36.         return $this;
  37.     }
  38.     public function getPhone(): ?string
  39.     {
  40.         return $this->phone;
  41.     }
  42.     public function setPhone(string $phone): self
  43.     {
  44.         $this->phone $phone;
  45.         return $this;
  46.     }
  47.     public function getEmail(): ?string
  48.     {
  49.         return $this->email;
  50.     }
  51.     public function setEmail(string $email): self
  52.     {
  53.         $this->email $email;
  54.         return $this;
  55.     }
  56.     public function getCreatedAt(): ?\DateTimeInterface
  57.     {
  58.         return $this->createdAt;
  59.     }
  60.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  61.     {
  62.         $this->createdAt $createdAt;
  63.         return $this;
  64.     }
  65.     public function getUpdatedAt(): ?\DateTimeInterface
  66.     {
  67.         return $this->updatedAt;
  68.     }
  69.     public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  70.     {
  71.         $this->updatedAt $updatedAt;
  72.         return $this;
  73.     }
  74.     #[ORM\PrePersist]
  75.     #[ORM\PreUpdate]
  76.     public function updateTimestamps()
  77.     {
  78.         if ($this->getCreatedAt()===null) {
  79.             $this->setCreatedAt(new \DateTimeImmutable);
  80.         }
  81.         $this->setUpdatedAt(new \DateTimeImmutable);
  82.     }
  83.     public function getAccountingFirm(): ?AccountingFirm
  84.     {
  85.         return $this->AccountingFirm;
  86.     }
  87.     public function setAccountingFirm(?AccountingFirm $AccountingFirm): self
  88.     {
  89.         $this->AccountingFirm $AccountingFirm;
  90.         return $this;
  91.     }
  92. }