public function getTitle()
    {
        $title = '';

        $titleComment = $this->getTitleComment();
        if (preg_match('/^\s*#+\s*(.+)/', $titleComment, $matches)) {
            $title = $matches[1];
        } elseif (self::isReferenceNumeric($this->getReference())) {
            return $this->getReference();
        } else {
            $reference = $this->getReferenceParts();
            return end($reference);
        }

        return $title;
    }