Neos.Neos/Classes/Domain/Repository/SiteRepository.php
public function findDefault()
    {
        if ($this->defaultSiteNodeName === null) {
            return $this->findOnline()->getFirst();
        }
        /**
         * @var Site $defaultSite
         */
        $defaultSite = $this->findOneByNodeName($this->defaultSiteNodeName);
        if (!$defaultSite instanceof Site || $defaultSite->getState() !== Site::STATE_ONLINE) {
            throw new NeosException(sprintf('DefaultSiteNode %s not found or not active', $this->defaultSiteNodeName), 1476374818);
        }
        return $defaultSite;
    }
public function findDefault()
    {
        if ($this->defaultSiteNodeName === null) {
            return $this->findOnline()->getFirst();
        }
        /**
         * @var Site $defaultSite
         */
        $defaultSite = $this->findOneByNodeName($this->defaultSiteNodeName);
        if (!$defaultSite instanceof Site || $defaultSite->getState() !== Site::STATE_ONLINE) {
            throw new NeosException(sprintf('DefaultSiteNode %s not found or not active', $this->defaultSiteNodeName), 1476374818);
        }
        return $defaultSite;
    }
public function findDefault ( ) { if ( $ this -> defaultSiteNodeName === null ) { return $ this -> findOnline ( ) -> getFirst ( ) ; } /**
         * @var Site $defaultSite
         */ $ defaultSite = $ this -> findOneByNodeName ( $ this -> defaultSiteNodeName ) ; if ( ! $ defaultSite instanceof Site || $ defaultSite -> getState ( ) !== Site :: STATE_ONLINE ) { throw new NeosException ( sprintf ( 'DefaultSiteNode %s not found or not active' , $ this -> defaultSiteNodeName ) , 1476374818 ) ; } return $ defaultSite ; }
Find the site that was specified in the configuration ``defaultSiteNodeName``

If the defaultSiteNodeName-setting is null the first active site is returned
If the site is not found or not active an exception is thrown

@return Site
@throws NeosException
Find the site that was specified in the configuration defaultSiteNodeName