src/Entity/CeContact.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CeContactRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassCeContactRepository::class)]
  6. class CeContact
  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'ceContacts')]
  23.     private $accountingFirm;
  24.     public function getId(): ?int
  25.     {
  26.         return $this->id;
  27.     }
  28.     public function getName(): ?string
  29.     {
  30.         return $this->name;
  31.     }
  32.     public function setName(string $name): self
  33.     {
  34.         $this->name $name;
  35.         return $this;
  36.     }
  37.     public function getPhone(): ?string
  38.     {
  39.         return $this->phone;
  40.     }
  41.     public function setPhone(string $phone): self
  42.     {
  43.         $this->phone $phone;
  44.         return $this;
  45.     }
  46.     public function getEmail(): ?string
  47.     {
  48.         return $this->email;
  49.     }
  50.     public function setEmail(string $email): self
  51.     {
  52.         $this->email $email;
  53.         return $this;
  54.     }
  55.     public function getCreatedAt(): ?\DateTimeInterface
  56.     {
  57.         return $this->createdAt;
  58.     }
  59.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  60.     {
  61.         $this->createdAt $createdAt;
  62.         return $this;
  63.     }
  64.     public function getUpdatedAt(): ?\DateTimeInterface
  65.     {
  66.         return $this->updatedAt;
  67.     }
  68.     public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  69.     {
  70.         $this->updatedAt $updatedAt;
  71.         return $this;
  72.     }
  73.     #[ORM\PrePersist]
  74.     #[ORM\PreUpdate]
  75.     public function updateTimestamps()
  76.     {
  77.         if ($this->getCreatedAt()===null) {
  78.             $this->setCreatedAt(new \DateTimeImmutable);
  79.         }
  80.         $this->setUpdatedAt(new \DateTimeImmutable);
  81.     }
  82.     public function getAccountingFirm(): ?AccountingFirm
  83.     {
  84.         return $this->accountingFirm;
  85.     }
  86.     public function setAccountingFirm(?AccountingFirm $accountingFirm): self
  87.     {
  88.         $this->accountingFirm $accountingFirm;
  89.         return $this;
  90.     }
  91. }