<?phpnamespace App\Entity;use App\Repository\NewslettersSubscribersRepository;use App\Traits\CommonTrt;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;/** * @ORM\Entity(repositoryClass=NewslettersSubscribersRepository::class) * @UniqueEntity(fields = {"email"}, message ="Désolé, cet email est déjà enregistré ! Prière le changer.") */class NewslettersSubscribers{ use CommonTrt; /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255, unique="true") */ private $email; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $validationToken; /** * @ORM\Column(type="boolean") */ private $isValid = false; /** * @ORM\OneToMany(targetEntity=NewslettersSent::class, mappedBy="subscribers") */ private $newslettersSents;// /**// * @ORM\Column(type="boolean")// */// private $is_rgpd; public function __construct() { $this->newslettersSents = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getEmail(): ?string { return $this->email; } public function setEmail(string $email): self { $this->email = $email; return $this; } public function getValidationToken(): ?string { return $this->validationToken; } public function setValidationToken(?string $validationToken): self { $this->validationToken = $validationToken; return $this; } public function getIsValid(): ?bool { return $this->isValid; } public function setIsValid(bool $isValid): self { $this->isValid = $isValid; return $this; } /** * @return Collection|NewslettersSent[] */ public function getNewslettersSents(): Collection { return $this->newslettersSents; } public function addNewslettersSent(NewslettersSent $newslettersSent): self { if (!$this->newslettersSents->contains($newslettersSent)) { $this->newslettersSents[] = $newslettersSent; $newslettersSent->setSubscribers($this); } return $this; } public function removeNewslettersSent(NewslettersSent $newslettersSent): self { if ($this->newslettersSents->removeElement($newslettersSent)) { // set the owning side to null (unless already changed) if ($newslettersSent->getSubscribers() === $this) { $newslettersSent->setSubscribers(null); } } return $this; }// public function getIsRgpd(): ?bool// {// return $this->is_rgpd;// }//// public function setIsRgpd(bool $is_rgpd): self// {// $this->is_rgpd = $is_rgpd;//// return $this;// }}