<?php
namespace App\Entity;
use App\Entity\Traits\Timestampable;
use App\Repository\DemoRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
#[ORM\Entity(repositoryClass: DemoRepository::class)]
#[ORM\HasLifecycleCallbacks]
#[UniqueEntity(fields: ['email'], message: 'Votre demande est déjà enregistré')]
class Demo
{
use Timestampable;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255)]
#[Assert\NotBlank(message: 'Veuillez entrer votre nom.')]
#[Assert\Length(min: 3,minMessage:'3 caractères au minimum' )]
private $name;
#[ORM\Column(type: 'string', length: 255)]
#[Assert\NotBlank(message: 'Veuillez entrer un numero de telephone.')]
#[Assert\Length(min: 10,minMessage:'Veuillez entrer un numero de telephone valide' )]
private $telephone;
#[ORM\Column(type: 'string', length: 255)]
#[Assert\NotBlank(message: 'Veuillez entrer une adresse mail.')]
#[Assert\Email(message: 'Votre adresse mail n est pas valide')]
private $email;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $page;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $afid;
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getTelephone(): ?string
{
return $this->telephone;
}
public function setTelephone(string $telephone): self
{
$this->telephone = $telephone;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}
public function getPage(): ?string
{
return $this->page;
}
public function setPage(?string $page): self
{
$this->page = $page;
return $this;
}
public function getAfid(): ?string
{
return $this->afid;
}
public function setAfid(?string $afid): self
{
$this->afid = $afid;
return $this;
}
}