*/ #[ORM\OneToMany(targetEntity: Announcement::class, mappedBy: 'status')] private Collection $announcements; public function __construct() { $this->announcements = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getLabel(): ?string { return $this->label; } public function setLabel(string $label): static { $this->label = $label; return $this; } /** * @return Collection */ public function getAnnouncements(): Collection { return $this->announcements; } public function addAnnouncement(Announcement $announcement): static { if (!$this->announcements->contains($announcement)) { $this->announcements->add($announcement); $announcement->setStatus($this); } return $this; } public function removeAnnouncement(Announcement $announcement): static { if ($this->announcements->removeElement($announcement)) { // set the owning side to null (unless already changed) if ($announcement->getStatus() === $this) { $announcement->setStatus(null); } } return $this; } }