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