public function removeTag($name) { foreach ($this->tags as $i => $tag) { if (strtolower($tag->getName()) == $name) { unset($this->tags[$i]); } } }