<?phpnamespace App\Entity;use App\Repository\NewsletterRepository;use DateTime;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Validator\Constraints as Assert;#[ORM\Entity(repositoryClass: NewsletterRepository::class)]#[ORM\Table(name: 'newsletter')]class Newsletter{ #[ORM\Column(type: 'boolean')] private bool $isDeleted = false; #[ORM\Column(name: 'createdAt', type: 'datetime')] private DateTime $createdAt; #[ORM\Id] #[ORM\Column(name: 'id', type: 'integer')] #[ORM\GeneratedValue(strategy: 'AUTO')] private int $id; #[Assert\NotBlank(message: 'Ce champ est obligatoire')] #[Assert\Email( message: "L'adresse email '{{ value }}' n'est pas valide." )] #[ORM\Column(name: 'email', type: 'string', length: 255)] private string $email; public function __construct() { $this->createdAt = new DateTime(); } public function __toString() { return "#" . $this->id . " - " . $this->email; } /** * Get id * * @return int */ public function getId() { return $this->id; } /** * Set email * * @param string $email * * @return Newsletter */ public function setEmail($email) { $this->email = $email; return $this; } /** * Get email * * @return string */ public function getEmail() { return $this->email; } /** * Set createdAt * * @param DateTime $createdAt * * @return Newsletter */ public function setCreatedAt($createdAt) { $this->createdAt = $createdAt; return $this; } /** * Get createdAt * * @return DateTime */ public function getCreatedAt() { return $this->createdAt; } /** * Set isDeleted * * @param boolean $isDeleted * * @return Newsletter */ public function setIsDeleted($isDeleted) { $this->isDeleted = $isDeleted; return $this; } /** * Get isDeleted * * @return boolean */ public function getIsDeleted() { return $this->isDeleted; }}