<?php
namespace 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 $id;
/**
* @Assert\NotBlank
* @ORM\Column(type="string", length=255)
*/
private string $pseudo;
/**
* @Assert\NotBlank
* @ORM\Column(type="string", length=255)
*/
private string $title;
/**
* @Assert\NotBlank
* @ORM\Column(type="text")
*/
private string $content;
/**
* @Assert\NotBlank
* @ORM\Column(type="string", length=255, nullable=false)
*/
private string $emailFrom;
/**
* @ORM\Column(type="boolean")
*/
private bool $alreadyRead = false;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private ?\Datetime $createdAt;
public function __construct()
{
$this->createdAt = new \DateTime();
}
public function getId(): ?int
{
return $this->id;
}
public function getPseudo(): ?string
{
return $this->pseudo;
}
public function setPseudo(string $pseudo): self
{
$this->pseudo = $pseudo;
return $this;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getContent(): ?string
{
return $this->content;
}
public function setContent(string $content): self
{
$this->content = $content;
return $this;
}
public function getEmailFrom(): ?string
{
return $this->emailFrom;
}
public function setEmailFrom(?string $emailFrom): self
{
$this->emailFrom = $emailFrom;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function isAlreadyRead(): bool
{
return $this->alreadyRead;
}
public function setAlreadyRead(bool $alreadyRead): void
{
$this->alreadyRead = $alreadyRead;
}
}