*/ #[ORM\OneToMany(targetEntity: News::class, mappedBy: 'type')] private Collection $news; public function __construct() { $this->news = new ArrayCollection(); } public function getId(): ?Uuid { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(string $name): static { $this->name = $name; return $this; } /** * @return Collection */ public function getNews(): Collection { return $this->news; } public function addNews(News $news): static { if (!$this->news->contains($news)) { $this->news->add($news); $news->setType($this); } return $this; } public function removeNews(News $news): static { if ($this->news->removeElement($news)) { // set the owning side to null (unless already changed) if ($news->getType() === $this) { $news->setType(null); } } return $this; } }