src/Entity/Contact.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ContactRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. /**
  7.  * @ORM\Entity(repositoryClass=ContactRepository::class)
  8.  */
  9. class Contact
  10. {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\GeneratedValue
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255)
  19.      * @Assert\NotBlank
  20.      */
  21.     private $nom;
  22.     /**
  23.      * @ORM\Column(type="string", length=255)
  24.      * @Assert\NotBlank
  25.      * @Assert\Email(
  26.      *     message = "The email '{{ value }}' is not a valid email."
  27.      * )
  28.      */
  29.     private $email;
  30.     /**
  31.      * @ORM\Column(type="string", length=255)
  32.      * @Assert\NotBlank
  33.      * @Assert\Length(min=12, max=12)
  34.      */
  35.     private $tel;
  36.     /**
  37.      * @ORM\Column(type="string", length=255)
  38.      * @Assert\NotBlank
  39.      */
  40.     private $message;
  41.     /**
  42.      * @ORM\Column(type="string", length=255)
  43.      * @Assert\NotBlank
  44.      */
  45.     private $sujet;
  46.     /**
  47.      * @ORM\Column(type="date", nullable=true)
  48.      */
  49.     private $date_message;
  50.     public function getId(): ?int
  51.     {
  52.         return $this->id;
  53.     }
  54.     public function getNom(): ?string
  55.     {
  56.         return $this->nom;
  57.     }
  58.     public function setNom(string $nom): self
  59.     {
  60.         $this->nom = $nom;
  61.         return $this;
  62.     }
  63.     public function getEmail(): ?string
  64.     {
  65.         return $this->email;
  66.     }
  67.     public function setEmail(string $email): self
  68.     {
  69.         $this->email = $email;
  70.         return $this;
  71.     }
  72.     public function getTel(): ?string
  73.     {
  74.         return $this->tel;
  75.     }
  76.     public function setTel(string $tel): self
  77.     {
  78.         $this->tel = $tel;
  79.         return $this;
  80.     }
  81.     public function getMessage(): ?string
  82.     {
  83.         return $this->message;
  84.     }
  85.     public function setMessage(string $message): self
  86.     {
  87.         $this->message = $message;
  88.         return $this;
  89.     }
  90.     public function getSujet(): ?string
  91.     {
  92.         return $this->sujet;
  93.     }
  94.     public function setSujet(string $sujet): self
  95.     {
  96.         $this->sujet = $sujet;
  97.         return $this;
  98.     }
  99.     public function getDateMessage(): ?\DateTimeInterface
  100.     {
  101.         return $this->date_message;
  102.     }
  103.     public function setDateMessage(\DateTimeInterface $date_message): self
  104.     {
  105.         $this->date_message = $date_message;
  106.         return $this;
  107.     }
  108. }