public function addTag(Tag $tag) { if (!$this->tags->contains($tag)) { $this->lastModified = new \DateTime(); $this->tags->add($tag); return true; } return false; }