timesheets = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function setName(string $tagName): Tag { $this->name = $tagName; return $this; } public function getName(): ?string { return $this->name; } public function addTimesheet(Timesheet $timesheet) { if ($this->timesheets->contains($timesheet)) { return; } $this->timesheets->add($timesheet); $timesheet->addTag($this); } public function removeTimesheet(Timesheet $timesheet) { if (!$this->timesheets->contains($timesheet)) { return; } $this->timesheets->removeElement($timesheet); $timesheet->removeTag($this); } /** * @return string */ public function __toString() { return $this->getName(); } }