Bolt\Storage\Entity\ContentValuesTrait::getTitle PHP Method

getTitle() public method

Get the title, name, caption or subject.
public getTitle ( $allowBasicTags = false ) : string
return string
    public function getTitle($allowBasicTags = false)
    {
        $titleParts = [];
        if ($allowBasicTags === true) {
            $allowedTags = '<b><del><em><i><strong><s>';
        } else {
            $allowedTags = '';
        }
        foreach ($this->getTitleColumnName() as $fieldName) {
            if (strip_tags($this->values[$fieldName], $allowedTags) !== '') {
                $titleParts[] = strip_tags($this->values[$fieldName], $allowedTags);
            }
        }
        if (!empty($titleParts)) {
            $title = implode(' ', $titleParts);
        } else {
            // nope, no title was found.
            $title = '';
        }
        return $title;
    }