src/Entity/Contacts/Newsletters.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Contacts;
  3. use App\Entity\Common\DatesTrait;
  4. use App\Entity\Common\IdTrait;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. /**
  8.  * @ORM\Entity(repositoryClass="App\Repository\Contacts\NewslettersRepository")
  9.  */
  10. class Newsletters
  11. {
  12.     use IdTrait;
  13.     use DatesTrait;
  14.     /**
  15.      * @var string
  16.      * @ORM\Column(type="string", length=100)
  17.      * @Assert\NotBlank(message="Veuillez saisir une adresse email")
  18.      * @Assert\Email(message="Veuillez saisir un email valide")
  19.      */
  20.     private $email;
  21.     /**
  22.      * @var bool
  23.      * @ORM\Column(type="boolean", options={"default": 0})
  24.      */
  25.     private $notification;
  26.     /**
  27.      * @return string|null
  28.      */
  29.     public function getEmail(): ?string
  30.     {
  31.         return $this->email;
  32.     }
  33.     /**
  34.      * @param string $email
  35.      * @return $this
  36.      */
  37.     public function setEmail(string $email): self
  38.     {
  39.         $this->email $email;
  40.         return $this;
  41.     }
  42.     /**
  43.      * @return bool|null
  44.      */
  45.     public function getNotification(): ?bool
  46.     {
  47.         return $this->notification;
  48.     }
  49.     /**
  50.      * @param bool $notif
  51.      * @return $this
  52.      */
  53.     public function setNotification(bool $notif): self
  54.     {
  55.         $this->notification $notif;
  56.         return $this;
  57.     }
  58. }