<?phpnamespace App\Entity;use App\Repository\MailingListRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=MailingListRepository::class) */class MailingList{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $content; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $sendgridId; /** * @ORM\OneToMany(targetEntity=User::class, mappedBy="mailingList") */ private $users; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $segmentId; public function __construct() { $this->users = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getContent(): ?string { return $this->content; } public function setContent(string $content): self { $this->content = $content; return $this; } public function getSendgridId(): ?string { return $this->sendgridId; } public function setSendgridId(string $sendgridId): self { $this->sendgridId = $sendgridId; return $this; } /** * @return Collection<int, User> */ public function getUsers(): Collection { return $this->users; } public function addUser(User $user): self { if (!$this->users->contains($user)) { $this->users[] = $user; $user->setMailingList($this); } return $this; } public function removeUser(User $user): self { if ($this->users->removeElement($user)) { // set the owning side to null (unless already changed) if ($user->getMailingList() === $this) { $user->setMailingList(null); } } return $this; } public function __toString() { return $this->content; } public function getSegmentId(): ?string { return $this->segmentId; } public function setSegmentId(string $segmentId): self { $this->segmentId = $segmentId; return $this; }}