src/Phlexible/Bundle/SiterootBundle/Entity/Siteroot.php
public function getTitle($language = null)
    {
        $fallbackLanguage = key($this->titles);
        if ($language === null) {
            $language = $fallbackLanguage;
        }

        if (!empty($this->titles[$language])) {
            return $this->titles[$language];
        }

        if (!empty($this->titles[$fallbackLanguage])) {
            return $this->titles[$fallbackLanguage];
        }

        $title = false;
        try {
            $defaultUrl = $this->getDefaultUrl();

            if ($defaultUrl) {
                $title = $defaultUrl->getHostname();
            }
        } catch (\Exception $e) {
        }

        if (!$title) {
            return '(No title)';
        }

        return $title;
    }
public function getTitle($language = null)
    {
        $fallbackLanguage = key($this->titles);
        if ($language === null) {
            $language = $fallbackLanguage;
        }

        if (!empty($this->titles[$language])) {
            return $this->titles[$language];
        }

        if (!empty($this->titles[$fallbackLanguage])) {
            return $this->titles[$fallbackLanguage];
        }

        $title = false;
        try {
            $defaultUrl = $this->getDefaultUrl();

            if ($defaultUrl) {
                $title = $defaultUrl->getHostname();
            }
        } catch (\Exception $e) {
        }

        if (!$title) {
            return '(No title)';
        }

        return $title;
    }
public function getTitle ( $ language = null ) { $ fallbackLanguage = key ( $ this -> titles ) ; if ( $ language === null ) { $ language = $ fallbackLanguage ; } if ( ! empty ( $ this -> titles [ $ language ] ) ) { return $ this -> titles [ $ language ] ; } if ( ! empty ( $ this -> titles [ $ fallbackLanguage ] ) ) { return $ this -> titles [ $ fallbackLanguage ] ; } $ title = false ; try { $ defaultUrl = $ this -> getDefaultUrl ( ) ; if ( $ defaultUrl ) { $ title = $ defaultUrl -> getHostname ( ) ; } } catch ( \ Exception $ e ) { } if ( ! $ title ) { return '(No title)' ; } return $ title ; }
Return siteroot title.

@param string $language

@return string
Return siteroot title .