/** * getSiteNotAvailableRedirectUrl * * @param Site $site * * @return string */ public function getSiteNotAvailableRedirectUrl(Site $site) { if ($site->isSiteAvailable()) { return null; } $defaultDomain = $this->domainService->getDefaultDomainName(); if (empty($defaultDomain)) { return null; } if ($defaultDomain == $site->getDomain()->getDomainName()) { return null; } return $defaultDomain; }
/** * getCurrentSite * * @param string|null $currentDomain * @param bool $useCache * * @return mixed|null|Site */ public function getCurrentSite($currentDomain = null, $useCache = true) { if ($this->isConsoleRequest()) { // Fake Site for console return new Site(); } if (empty($currentDomain)) { $currentDomain = $this->getCurrentDomain($this->domainService->getDefaultDomainName()); } return $this->getSite($currentDomain, $useCache); }