src/Entity/Contact.php line 12

Open in your IDE?
  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. /**
  7.  * @ORM\Entity(repositoryClass=ContactRepository::class)
  8.  */
  9. class Contact
  10. {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\GeneratedValue
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @Assert\NotBlank
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private string $pseudo;
  22.     /**
  23.      * @Assert\NotBlank
  24.      * @ORM\Column(type="string", length=255)
  25.      */
  26.     private string $title;
  27.     /**
  28.      * @Assert\NotBlank
  29.      * @ORM\Column(type="text")
  30.      */
  31.     private string $content;
  32.     /**
  33.      * @Assert\NotBlank
  34.      * @ORM\Column(type="string", length=255, nullable=false)
  35.      */
  36.     private string $emailFrom;
  37.     /**
  38.      * @ORM\Column(type="boolean")
  39.      */
  40.     private bool $alreadyRead false;
  41.     /**
  42.      * @ORM\Column(type="datetime", nullable=true)
  43.      */
  44.     private ?\Datetime $createdAt;
  45.     public function __construct()
  46.     {
  47.         $this->createdAt = new \DateTime();
  48.     }
  49.     public function getId(): ?int
  50.     {
  51.         return $this->id;
  52.     }
  53.     public function getPseudo(): ?string
  54.     {
  55.         return $this->pseudo;
  56.     }
  57.     public function setPseudo(string $pseudo): self
  58.     {
  59.         $this->pseudo $pseudo;
  60.         return $this;
  61.     }
  62.     public function getTitle(): ?string
  63.     {
  64.         return $this->title;
  65.     }
  66.     public function setTitle(string $title): self
  67.     {
  68.         $this->title $title;
  69.         return $this;
  70.     }
  71.     public function getContent(): ?string
  72.     {
  73.         return $this->content;
  74.     }
  75.     public function setContent(string $content): self
  76.     {
  77.         $this->content $content;
  78.         return $this;
  79.     }
  80.     public function getEmailFrom(): ?string
  81.     {
  82.         return $this->emailFrom;
  83.     }
  84.     public function setEmailFrom(?string $emailFrom): self
  85.     {
  86.         $this->emailFrom $emailFrom;
  87.         return $this;
  88.     }
  89.     public function getCreatedAt(): ?\DateTimeInterface
  90.     {
  91.         return $this->createdAt;
  92.     }
  93.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  94.     {
  95.         $this->createdAt $createdAt;
  96.         return $this;
  97.     }
  98.     public function isAlreadyRead(): bool
  99.     {
  100.         return $this->alreadyRead;
  101.     }
  102.     public function setAlreadyRead(bool $alreadyRead): void
  103.     {
  104.         $this->alreadyRead $alreadyRead;
  105.     }
  106. }