public function getTitle()
    {
        $fields = $this->_fields;

        if (array_key_exists('title', $fields)) {
            return (string) $fields['title'];
        }

        $fieldNames = $this->getTitleColumnNames($this->contenttype);

        $title = [];
        foreach ($fieldNames as $fieldName) {
            // Make sure we add strings only, as some fields may be an array or DateTime.
            if (array_key_exists($fieldName, $fields)) {
                $title[] = is_array($fields[$fieldName]) ? implode(' ', $fields[$fieldName]) : (string) $fields[$fieldName];
            }
        }

        return implode(' ', $title);
    }
public function getTitle()
    {
        $fields = $this->_fields;

        if (array_key_exists('title', $fields)) {
            return (string) $fields['title'];
        }

        $fieldNames = $this->getTitleColumnNames($this->contenttype);

        $title = [];
        foreach ($fieldNames as $fieldName) {
            // Make sure we add strings only, as some fields may be an array or DateTime.
            if (array_key_exists($fieldName, $fields)) {
                $title[] = is_array($fields[$fieldName]) ? implode(' ', $fields[$fieldName]) : (string) $fields[$fieldName];
            }
        }

        return implode(' ', $title);
    }
public function getTitle ( ) { $ fields = $ this -> _fields ; if ( array_key_exists ( 'title' , $ fields ) ) { return ( string ) $ fields [ 'title' ] ; } $ fieldNames = $ this -> getTitleColumnNames ( $ this -> contenttype ) ; $ title = [ ] ; foreach ( $ fieldNames as $ fieldName ) { // Make sure we add strings only, as some fields may be an array or DateTime. if ( array_key_exists ( $ fieldName , $ fields ) ) { $ title [ ] = is_array ( $ fields [ $ fieldName ] ) ? implode ( ' ' , $ fields [ $ fieldName ] ) : ( string ) $ fields [ $ fieldName ] ; } } return implode ( ' ' , $ title ) ; }
Getter for a record's 'title' field.

If there is no field called 'title' then we just return the first text
type field.

@return string
Getter for a record s title field .