src/Entity/Contact.php line 12

  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. #[ORM\Entity(repositoryClassContactRepository::class)]
  7. class Contact
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column(type'integer')]
  12.     private $id;
  13.     #[Assert\NotBlank]
  14.     #[ORM\Column(type'string'length255)]
  15.     private string $pseudo;
  16.     #[Assert\NotBlank]
  17.     #[ORM\Column(type'string'length255)]
  18.     private string $title;
  19.     #[Assert\NotBlank]
  20.     #[ORM\Column(type'text')]
  21.     private string $content;
  22.     #[Assert\NotBlank]
  23.     #[ORM\Column(type'string'length255nullablefalse)]
  24.     private string $emailFrom;
  25.     #[ORM\Column(type'boolean')]
  26.     private bool $alreadyRead false;
  27.     #[ORM\Column(type'datetime'nullabletrue)]
  28.     private ?\Datetime $createdAt;
  29.     public function __construct()
  30.     {
  31.         $this->createdAt = new \DateTime();
  32.     }
  33.     public function getId(): ?int
  34.     {
  35.         return $this->id;
  36.     }
  37.     public function getPseudo(): ?string
  38.     {
  39.         return $this->pseudo;
  40.     }
  41.     public function setPseudo(string $pseudo): self
  42.     {
  43.         $this->pseudo $pseudo;
  44.         return $this;
  45.     }
  46.     public function getTitle(): ?string
  47.     {
  48.         return $this->title;
  49.     }
  50.     public function setTitle(string $title): self
  51.     {
  52.         $this->title $title;
  53.         return $this;
  54.     }
  55.     public function getContent(): ?string
  56.     {
  57.         return $this->content;
  58.     }
  59.     public function setContent(string $content): self
  60.     {
  61.         $this->content $content;
  62.         return $this;
  63.     }
  64.     public function getEmailFrom(): ?string
  65.     {
  66.         return $this->emailFrom;
  67.     }
  68.     public function setEmailFrom(?string $emailFrom): self
  69.     {
  70.         $this->emailFrom $emailFrom;
  71.         return $this;
  72.     }
  73.     public function getCreatedAt(): ?\DateTimeInterface
  74.     {
  75.         return $this->createdAt;
  76.     }
  77.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  78.     {
  79.         $this->createdAt $createdAt;
  80.         return $this;
  81.     }
  82.     public function isAlreadyRead(): bool
  83.     {
  84.         return $this->alreadyRead;
  85.     }
  86.     public function setAlreadyRead(bool $alreadyRead): void
  87.     {
  88.         $this->alreadyRead $alreadyRead;
  89.     }
  90. }