<?phpnamespace App\Entity;use App\Repository\ContactRepository;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Validator\Constraints as Assert;#[ORM\Entity(repositoryClass: ContactRepository::class)]class Contact{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: 'integer')] private int $id; #[ORM\Column(type: 'string', length: 50)] #[Assert\NotBlank()] #[Assert\Length(min: 2)] private string $name; #[ORM\Column(type: 'string', length: 50)] #[Assert\NotBlank()] #[Assert\Email()] private string $email; #[ORM\Column(type: 'string', length: 20, nullable: true)] #[Assert\Regex( pattern: '/[0-9]{10}/' )] private ?string $phone; #[ORM\Column(type: 'string', length: 255)] #[Assert\NotBlank()] private string $subject; #[ORM\Column(type: 'text')] #[Assert\NotBlank()] private string $message; #[ORM\Column(type: 'datetime')] private \DateTime $send_at; public function __construct() { $this->phone = null; } 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 getEmail(): ?string { return $this->email; } public function setEmail(string $email): self { $this->email = $email; return $this; } public function getPhone(): ?string { return $this->phone; } public function setPhone(string $phone): self { $this->phone = $phone; return $this; } public function getSubject(): ?string { return $this->subject; } public function setSubject(string $subject): self { $this->subject = $subject; return $this; } public function getMessage(): ?string { return $this->message; } public function setMessage(string $message): self { $this->message = $message; return $this; } public function getSendAt(): ?\DateTime { return $this->send_at; } public function setSendAt(\DateTime $send_at): self { $this->send_at = $send_at; return $this; }}