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