src/Entity/PipelineContact.php line 12

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity;
  4. use App\Repository\PipelineContactRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassPipelineContactRepository::class)]
  7. #[ORM\Table(name'pipeline_contact')]
  8. class PipelineContact
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private ?int $id null;
  14.     /**
  15.      * Libellé affiché dans le select admin (ex: "Amira", "Karine", ...)
  16.      */
  17.     #[ORM\Column(type'string'length120)]
  18.     private string $label;
  19.     /**
  20.      * Email du contact (affiché dans le mail / utilisé en reply-to si besoin)
  21.      */
  22.     #[ORM\Column(type'string'length180)]
  23.     private string $email;
  24.     /**
  25.      * Lien Calendly à utiliser pour ce contact
  26.      */
  27.     #[ORM\Column(type'string'length255)]
  28.     private string $calendlyLink;
  29.     /**
  30.      * Optionnel : permet de désactiver un contact sans le supprimer
  31.      */
  32.     #[ORM\Column(type'boolean')]
  33.     private bool $isActive true;
  34.     public function __toString(): string
  35.     {
  36.         return $this->label;
  37.     }
  38.     #[ORM\Column(type'datetime_immutable')]
  39.     private \DateTimeImmutable $createdAt;
  40.     #[ORM\Column(type'datetime_immutable')]
  41.     private \DateTimeImmutable $updatedAt;
  42.     public function __construct()
  43.     {
  44.         $now = new \DateTimeImmutable();
  45.         $this->createdAt $now;
  46.         $this->updatedAt $now;
  47.     }
  48.     public function getId(): ?int
  49.     {
  50.         return $this->id;
  51.     }
  52.     public function getLabel(): string
  53.     {
  54.         return $this->label;
  55.     }
  56.     public function setLabel(string $label): self
  57.     {
  58.         $this->label $label;
  59.         return $this;
  60.     }
  61.     public function getEmail(): string
  62.     {
  63.         return $this->email;
  64.     }
  65.     public function setEmail(string $email): self
  66.     {
  67.         $this->email $email;
  68.         return $this;
  69.     }
  70.     public function getCalendlyLink(): string
  71.     {
  72.         return $this->calendlyLink;
  73.     }
  74.     public function setCalendlyLink(string $calendlyLink): self
  75.     {
  76.         $this->calendlyLink $calendlyLink;
  77.         return $this;
  78.     }
  79.     public function isActive(): bool
  80.     {
  81.         return $this->isActive;
  82.     }
  83.     public function setIsActive(bool $isActive): self
  84.     {
  85.         $this->isActive $isActive;
  86.         return $this;
  87.     }
  88.     public function getCreatedAt(): \DateTimeImmutable
  89.     {
  90.         return $this->createdAt;
  91.     }
  92.     public function getUpdatedAt(): \DateTimeImmutable
  93.     {
  94.         return $this->updatedAt;
  95.     }
  96.     public function touch(): self
  97.     {
  98.         $this->updatedAt = new \DateTimeImmutable();
  99.         return $this;
  100.     }
  101. }