src/Sulu/Component/Webspace/Webspace.php
public function hasDomain($domain, $environment, $locale = null)
    {
        $localizationParts = explode('_', $locale);
        $language = $localizationParts[0];
        $country = isset($localizationParts[1]) ? $localizationParts[1] : '';

        foreach ($this->getPortals() as $portal) {
            foreach ($portal->getEnvironment($environment)->getUrls() as $url) {
                $host = parse_url('//' . $url->getUrl())['host'];
                if ((null === $locale || $url->isValidLocale($language, $country))
                    && ($host === $domain || '{host}' === $host)
                ) {
                    return true;
                }
            }
        }

        return false;
    }
public function hasDomain($domain, $environment, $locale = null)
    {
        $localizationParts = explode('_', $locale);
        $language = $localizationParts[0];
        $country = isset($localizationParts[1]) ? $localizationParts[1] : '';

        foreach ($this->getPortals() as $portal) {
            foreach ($portal->getEnvironment($environment)->getUrls() as $url) {
                $host = parse_url('//' . $url->getUrl())['host'];
                if ((null === $locale || $url->isValidLocale($language, $country))
                    && ($host === $domain || '{host}' === $host)
                ) {
                    return true;
                }
            }
        }

        return false;
    }
public function hasDomain ( $ domain , $ environment , $ locale = null ) { $ localizationParts = explode ( '_' , $ locale ) ; $ language = $ localizationParts [ 0 ] ; $ country = isset ( $ localizationParts [ 1 ] ) ? $ localizationParts [ 1 ] : '' ; foreach ( $ this -> getPortals ( ) as $ portal ) { foreach ( $ portal -> getEnvironment ( $ environment ) -> getUrls ( ) as $ url ) { $ host = parse_url ( '//' . $ url -> getUrl ( ) ) [ 'host' ] ; if ( ( null === $ locale || $ url -> isValidLocale ( $ language , $ country ) ) && ( $ host === $ domain || '{host}' === $ host ) ) { return true ; } } } return false ; }
Returns false if domain not exists in webspace.

@param string $domain
@param string $environment
@param string $locale

@return bool

@throws Exception\EnvironmentNotFoundException
Returns false if domain not exists in webspace .