Get defaultDomain.

@return string
977908
public function getDefaultDomain()
    {
        if ($this->defaultDomain) {
            return $this->defaultDomain;
        } elseif ($first = $this->getDomains()->first()) {
            return $first->getDomain();
        } else {
            return null;
        }
    }
853894
public function getDefaultAddress()
    {
        if ($this->cached_address) {
            return $this->cached_address;
        } else {
            $address = $this
                ->owner
                ->Addresses()
                ->sort("Default", "DESC")
                ->first();
                
            $this->cached_address = $address;
            
            return $address;
        }
    }
232176
public function getDomain()
    {
        $result = $this->host;
        if(null !== $this->port)
        {
            $result .= ':' . $this->port;
        }
        return $result;
    }
284430
public function getDomainPart()
    {
        $parts = \explode('@', $this->toNative());
        $domain = \trim($parts[1], '[]');

        return Domain::specifyType($domain);
    }
908927
public function getDefaultWebsiteId()
    {
        $defaultReport = $this->getDefaultReport();

        if (is_numeric($defaultReport) && Piwik::isUserHasViewAccess($defaultReport)) {
            return $defaultReport;
        }

        $sitesId = APISitesManager::getInstance()->getSitesIdWithAtLeastViewAccess();

        if (!empty($sitesId)) {
            return $sitesId[0];
        }

        return false;
    }
1131096
public function getWebPath()
    {
        $webPath = $this->environment->getCurrentEnvironmentConfig()->get('Domain', false);
        if (!$webPath) {
            $webPath = Request::getInstance()->getCurrentUrl(true)->getDomain() . '/';
        }

        return $webPath;
    }
776225
public function GetThirdLevelDomain () {
		if ($this->domainParts === NULL) $this->initDomainSegments();
		return isset($this->domainParts[0]) ? $this->domainParts[0] : NULL;
	}
543830
public function getDomainByName($domainName, $default = null)
    {
        if (empty($domainName)) {
            return $default;
        }

        try {
            $result = $this->findOneBy(['domain' => $domainName]);
        } catch (NoResultException $e) {
            $result = $default;
        }

        return $result;
    }
547597
public function getName()
    {
        if ($this->_name === null) {
            $this->_name = $this->defaultName();
        }
        return $this->_name;
    }
386886
public function defaultUrl(): string
    {
        if (!empty($this->hook_names[$this->App->Config->©brand['©slug']])) {
            return $this->url(); // Nothing special in this case.
            //
        } else { // Search for sub-menu item matching slug regex pattern.
            $_page_regex = $this->c::escRegex($this->App->Config->©brand['©slug']);

            foreach ($this->hook_names as $_hook_page_key => $_hook_name) { // Find parent page.
                if (preg_match('/^(?<parent_page>[^:]+)\:(?<page>'.$_page_regex.')$/u', $_hook_page_key, $_m)) {
                    return $this->url($_m['parent_page'], ['page' => $_m['page']]);
                }
            } // unset($_page_regex, $_hook_page_key, $_hook_name); // Houskeeping.
        }
        return ''; // Not possible.
    }
423250
public function getBaseURL()
    {
        $base = Director::baseURL();

        // Prepend hostname for domain mode
        $domain = $this->getDomain();
        if ($domain) {
            $base = Controller::join_links($domain->Link(), $base);
        }

        // Determine if base suffix should be appended
        $append = true;
        if ($this->getIsDefault()) {
            // Apply config
            $append = !(bool) Config::inst()->get(FluentDirectorExtension::class, 'disable_default_prefix');
        }

        if ($append) {
            // Append locale url segment
            $base = Controller::join_links($base, $this->getURLSegment(), '/');
        }

        return $base;
    }
1195300
public function getFullHost()
    {
        // Case 1: Host hasn't suffix, possibly IP.

        if (null === $this->suffix) {
            return $this->hostname;
        }

        // Case 2: Domain with suffix, but without subdomain.

        if (null === $this->subdomain) {
            return $this->hostname . '.' . $this->suffix;
        }

        // Case 3: Domain with suffix & subdomain.

        return implode('.', [$this->subdomain, $this->hostname, $this->suffix]);
    }
1266173
public static function getServerURL()
    {
        if ( self::$serverURL === null  )
        {
            $oeini = eZINI::instance( 'ezoe.ini' );
            if ( $oeini->hasVariable( 'SystemSettings', 'RelativeURL' ) &&
                 $oeini->variable( 'SystemSettings', 'RelativeURL' ) === 'enabled' )
            {
                self::$serverURL = eZSys::wwwDir();
                if ( self::$serverURL === '/'  )
                    self::$serverURL = '';
            }
            else
            {
                $domain = eZSys::hostname();
                $protocol = eZSys::serverProtocol();

                self::$serverURL = $protocol . '://' . $domain . eZSys::wwwDir();
            }
        }
        return self::$serverURL;
    }
139094
public function getDomains()
    {
        $q = $this
            ->createQueryBuilder('m')
            ->select('m.domain')
            ->distinct()
            ->orderBy('m.domain');

        $ret = array();
        foreach ($q->getQuery()->execute() as $result) {
            $ret[$result['domain']] = $result['domain'];
        }
        return $ret;
    }
622533
protected function getRootPagesWithoutDomain()
    {
        $rootPagesWithoutDomain = [];
        $rootPages = $this->getRootPages();

        $rootPageIds = [];
        foreach ($rootPages as $rootPage) {
            $rootPageIds[] = $rootPage['uid'];
        }

        $domainRecords = $this->systemDomainRepository->findDomainRecordsByRootPagesIds($rootPageIds);
        foreach ($rootPageIds as $rootPageId) {
            $hasDomainRecord = true;
            $hasDomainInTypoScript = true;

            if (!array_key_exists($rootPageId, $domainRecords)) {
                $hasDomainRecord = false;
            }

            /** @var $siteService SiteService */
            $siteService = GeneralUtility::makeInstance(SiteService::class);
            $domain = $siteService->getFirstDomainForRootPage($rootPageId);
            if ($domain === '') {
                $hasDomainInTypoScript = false;
            }

            if (!$hasDomainRecord && !$hasDomainInTypoScript) {
                $rootPagesWithoutDomain[$rootPageId] = $rootPages[$rootPageId];
            }
        }
        return $rootPagesWithoutDomain;
    }
970304
public function getDomain()
    {
        if($this->getScheme() && $this->getHost()) {
            return $this->getScheme() . '://' . $this->getHost();
        }

        return false;
    }
1152806
public function getDomain($first_level = false)
    {
        $host = $this->getHost();

        if (empty($host)) {
            return '';
        }

        $host = array_reverse(explode('.', $host));

        switch (count($host)) {
            case 1:
                return $host[0];

            case 2:
                return $first_level ? ($host[1].'.'.$host[0]) : $host[1];

            default:
                if ($first_level) {
                    return ($host[1] === 'co' || $host[1] === 'com') ? ($host[2].'.'.$host[1].'.'.$host[0]) : ($host[1].'.'.$host[0]);
                }

                return ($host[1] === 'co' || $host[1] === 'com') ? $host[2] : $host[1];
        }
    }