*/ #[ORM\ManyToMany(targetEntity: 'App\Entity\Timesheet', mappedBy: 'tags', fetch: 'EXTRA_LAZY')] private Collection $timesheets; public function __construct() { $this->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): void { if ($this->timesheets->contains($timesheet)) { return; } $this->timesheets->add($timesheet); $timesheet->addTag($this); } public function removeTimesheet(Timesheet $timesheet): void { if (!$this->timesheets->contains($timesheet)) { return; } $this->timesheets->removeElement($timesheet); $timesheet->removeTag($this); } public function __toString(): string { return $this->getName(); } }