/** * * @param Tag $tag */ public function addTag($tag) { if ($tag instanceof Tag) { $this->tags[$tag->getName()] = $tag; } }