src/Entity/Audit.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\Timestampable;
  4. use App\Repository\AuditRepository;
  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(repositoryClassAuditRepository::class)]
  9. #[ORM\Table(name"audits")]
  10. #[ORM\HasLifecycleCallbacks]
  11. #[UniqueEntity(fields: ['email'], message'Votre demande est déjà enregistré'groups: ['unique_audit_email'])]
  12. class Audit
  13. {
  14.     use Timestampable;
  15.     #[ORM\Id]
  16.     #[ORM\GeneratedValue]
  17.     #[ORM\Column(type'integer')]
  18.     private $id;
  19.     #[ORM\Column(type'string'length255)]
  20.     #[Assert\NotBlank(message'Veuillez entrer votre nom.')]
  21.     #[Assert\Length(min3,minMessage:'3 caractéres au minimum' )]
  22.     private $name;
  23.     #[ORM\Column(type'string'length255nullabletrue)]
  24.     // Contraintes rattachées au groupe 'with_telephone' : le téléphone reste
  25.     // obligatoire pour les formulaires qui l'incluent (AuditType), mais peut
  26.     // être omis par ceux qui ne l'utilisent pas (AuditLinkedinType).
  27.     #[Assert\NotBlank(message'Veuillez entrer un numero de telephone.'groups: ['with_telephone'])]
  28.     #[Assert\Length(min10minMessage'Veuillez entrer un numero de telephone valide'groups: ['with_telephone'])]
  29.     private $telephone;
  30.     #[ORM\Column(type'string'length255)]
  31.     #[Assert\NotBlank(message'Veuillez entrer une adresse mail.')]
  32.     #[Assert\Email(message'Votre adresse mail n est pas valide')]
  33.     private $email;
  34.     #[ORM\Column(type'text'nullabletrue)]
  35.     private $message;
  36.     #[ORM\Column(type'string'length255nullabletrue)]
  37.     private $page;
  38.     #[ORM\Column(type'string'length255nullabletrue)]
  39.     private $afid;
  40.     public function getId(): ?int
  41.     {
  42.         return $this->id;
  43.     }
  44.     public function getName(): ?string
  45.     {
  46.         return $this->name;
  47.     }
  48.     public function setName(string $name): self
  49.     {
  50.         $this->name $name;
  51.         return $this;
  52.     }
  53.     public function getTelephone(): ?string
  54.     {
  55.         return $this->telephone;
  56.     }
  57.     public function setTelephone(string $telephone): self
  58.     {
  59.         $this->telephone $telephone;
  60.         return $this;
  61.     }
  62.     public function getEmail(): ?string
  63.     {
  64.         return $this->email;
  65.     }
  66.     public function setEmail(string $email): self
  67.     {
  68.         $this->email $email;
  69.         return $this;
  70.     }
  71.     public function getMessage(): ?string
  72.     {
  73.         return $this->message;
  74.     }
  75.     public function setMessage(string $message): self
  76.     {
  77.         $this->message $message;
  78.         return $this;
  79.     }
  80.     public function getPage(): ?string
  81.     {
  82.         return $this->page;
  83.     }
  84.     public function setPage(?string $page): self
  85.     {
  86.         $this->page $page;
  87.         return $this;
  88.     }
  89.     public function getAfid(): ?string
  90.     {
  91.         return $this->afid;
  92.     }
  93.     public function setAfid(?string $afid): self
  94.     {
  95.         $this->afid $afid;
  96.         return $this;
  97.     }
  98. }