src/Entity/EmailingProspect.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\EmailingProspectRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. #[ORM\Entity(repositoryClassEmailingProspectRepository::class)]
  8. #[UniqueEntity(fields: ['email'], message'Cet e-mail existe déjà')]
  9. class EmailingProspect
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column(type'integer')]
  14.     private $id;
  15.     #[ORM\Column(type'string'length255)]
  16.     #[Assert\NotBlank(message"L'email ne doit pas être vide.")]
  17.     #[Assert\Email(message"L'email {{ value }} n'est pas valide.")]
  18.     private $email;
  19.     #[ORM\Column(type'boolean'nullabletrue)]
  20.     private $unsubscribe;
  21.     #[ORM\Column(type'boolean'nullabletrue)]
  22.     private $remove;
  23.     #[ORM\Column(type'datetime_immutable')]
  24.     private $createdAt;
  25.     public function __construct()
  26.     {
  27.         $this->createdAt = new \DateTimeImmutable();
  28.     }
  29.     public function getId(): ?int
  30.     {
  31.         return $this->id;
  32.     }
  33.     public function getEmail(): ?string
  34.     {
  35.         return $this->email;
  36.     }
  37.     public function setEmail(string $email): self
  38.     {
  39.         $this->email $email;
  40.         return $this;
  41.     }
  42.     public function isUnsubscribe(): ?bool
  43.     {
  44.         return $this->unsubscribe;
  45.     }
  46.     public function setUnsubscribe(?bool $unsubscribe): self
  47.     {
  48.         $this->unsubscribe $unsubscribe;
  49.         return $this;
  50.     }
  51.     public function isRemove(): ?bool
  52.     {
  53.         return $this->remove;
  54.     }
  55.     public function setRemove(?bool $remove): self
  56.     {
  57.         $this->remove $remove;
  58.         return $this;
  59.     }
  60.     public function getCreatedAt(): ?\DateTimeImmutable
  61.     {
  62.         return $this->createdAt;
  63.     }
  64.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  65.     {
  66.         $this->createdAt $createdAt;
  67.         return $this;
  68.     }
  69. }