src/Entity/Demo.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\Timestampable;
  4. use App\Repository\DemoRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  8. #[ORM\Entity(repositoryClassDemoRepository::class)]
  9. #[ORM\HasLifecycleCallbacks]
  10. #[UniqueEntity(fields: ['email'], message'Votre demande est déjà enregistré')]
  11. class Demo
  12. {
  13.     use Timestampable;
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column(type'integer')]
  17.     private $id;
  18.     #[ORM\Column(type'string'length255)]
  19.     #[Assert\NotBlank(message'Veuillez entrer votre nom.')]
  20.     #[Assert\Length(min3,minMessage:'3 caractères au minimum' )]
  21.     private $name;
  22.     #[ORM\Column(type'string'length255)]
  23.     #[Assert\NotBlank(message'Veuillez entrer un numero de telephone.')]
  24.     #[Assert\Length(min10,minMessage:'Veuillez entrer un numero de telephone valide' )]
  25.     private $telephone;
  26.     #[ORM\Column(type'string'length255)]
  27.     #[Assert\NotBlank(message'Veuillez entrer une adresse mail.')]
  28.     #[Assert\Email(message'Votre adresse mail n est pas valide')]
  29.     private $email;
  30.     #[ORM\Column(type'string'length255nullabletrue)]
  31.     private $page;
  32.     #[ORM\Column(type'string'length255nullabletrue)]
  33.     private $afid;
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getName(): ?string
  39.     {
  40.         return $this->name;
  41.     }
  42.     public function setName(string $name): self
  43.     {
  44.         $this->name $name;
  45.         return $this;
  46.     }
  47.     public function getTelephone(): ?string
  48.     {
  49.         return $this->telephone;
  50.     }
  51.     public function setTelephone(string $telephone): self
  52.     {
  53.         $this->telephone $telephone;
  54.         return $this;
  55.     }
  56.     public function getEmail(): ?string
  57.     {
  58.         return $this->email;
  59.     }
  60.     public function setEmail(string $email): self
  61.     {
  62.         $this->email $email;
  63.         return $this;
  64.     }
  65.     public function getPage(): ?string
  66.     {
  67.         return $this->page;
  68.     }
  69.     public function setPage(?string $page): self
  70.     {
  71.         $this->page $page;
  72.         return $this;
  73.     }
  74.     public function getAfid(): ?string
  75.     {
  76.         return $this->afid;
  77.     }
  78.     public function setAfid(?string $afid): self
  79.     {
  80.         $this->afid $afid;
  81.         return $this;
  82.     }
  83. }