src/Entity/Newsletter.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Symfony\Component\Uid\Uuid;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use App\Repository\NewsletterRepository;
  6. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  7. /**
  8.  * @ORM\Entity(repositoryClass=NewsletterRepository::class)
  9.  * @UniqueEntity(fields={"email"}, message="Cet email est déjà enregistré dans la newsletter")
  10.  */
  11. class Newsletter
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=255, nullable=true)
  21.      */
  22.     private $uuid;
  23.     /**
  24.      * @ORM\Column(type="string", length=255, nullable=true)
  25.      */
  26.     private $token;
  27.     /**
  28.      * @ORM\Column(type="string", length=255, nullable=true)
  29.      */
  30.     private $email;
  31.     /**
  32.      * @ORM\Column(type="boolean", nullable=true)
  33.      */
  34.     private $statut false;
  35.     /**
  36.      * @ORM\Column(type="datetime_immutable", nullable=true)
  37.      */
  38.     private $createdAt;
  39.     /**
  40.      * @ORM\Column(type="datetime", nullable=true)
  41.      */
  42.     private $updatedAt;
  43.     public function __construct()
  44.     {
  45.         $this->uuid Uuid::v4();
  46.     }
  47.     public function getId(): ?int
  48.     {
  49.         return $this->id;
  50.     }
  51.     public function getUuid(): ?string
  52.     {
  53.         return $this->uuid;
  54.     }
  55.     public function setUuid(?string $uuid): self
  56.     {
  57.         $this->uuid $uuid;
  58.         return $this;
  59.     }
  60.     public function getToken(): ?string
  61.     {
  62.         return $this->token;
  63.     }
  64.     public function setToken(?string $token): self
  65.     {
  66.         $this->token $token;
  67.         return $this;
  68.     }
  69.     public function getEmail(): ?string
  70.     {
  71.         return $this->email;
  72.     }
  73.     public function setEmail(?string $email): self
  74.     {
  75.         $this->email $email;
  76.         return $this;
  77.     }
  78.     public function isStatut(): ?bool
  79.     {
  80.         return $this->statut;
  81.     }
  82.     public function setStatut(?bool $statut): self
  83.     {
  84.         $this->statut $statut;
  85.         return $this;
  86.     }
  87.     
  88.     public function getCreatedAt(): ?\DateTimeImmutable
  89.     {
  90.         return $this->createdAt;
  91.     }
  92.     public function setCreatedAt(?\DateTimeImmutable $createdAt): self
  93.     {
  94.         $this->createdAt $createdAt;
  95.         return $this;
  96.     }
  97.     public function getUpdatedAt(): ?\DateTimeInterface
  98.     {
  99.         return $this->updatedAt;
  100.     }
  101.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  102.     {
  103.         $this->updatedAt $updatedAt;
  104.         return $this;
  105.     }
  106. }