@param Site $site

@return self
516977
public static function createFromSite(Site $site): self
    {
        $message = new self();
        $message->setId($site->getId());
        $message->setHost($site->getHost());
        $message->setBillingStatus($site->getBillingStatus());
        $message->setContactEmail($site->getContactEmail());
        $message->setCompanyId($site->getCompanyId());
        $message->setThemeId($site->getThemeId());
        $message->setTitle($site->getTitle());

        return $message;
    }
676719
public function setActiveSite($siteID) {
		if($this->owner->config()->use_active_site_session) {
			Multisites::inst()->setActiveSite($siteID);
		} else {
			$this->owner->getRequest()->getSession()->set($this->getActiveSiteSessionKey(), $siteID);
		}
	}
346618
public function save($site)
    {

        if (is_array($site)) {
            $siteData = $site;
            if ($site['id'] > 0) {
                $site = $this->find($site['id']);
            } else {
                $site = new Site();
            }
            $this->assignArrayToObject($site, $siteData);
        } else if (!($site instanceof Site)) {
            $this->addErrorMessage(self::ERROR_WRONG_OBJECT);
        }

        if (!$this->hasError()) {
            $check = $this->siteManager->save($site);
            if ($check) {
                $this->addSuccessMessage(self::SUCCESS_SAVED);
            }
        }

        return $site;
    }
1109575
public function setSite(\BiberLtd\Bundle\SiteManagementBundle\Entity\Site $site) {
        if(!$this->setModified('site', $site)->isModified()) {
            return $this;
        }
		$this->site = $site;
		return $this;
    }
482285
public function setCurrentSite( $site )
    {
        eZWebDAVContentBackend::appendLogEntry( __FUNCTION__ . '1:' . $site );
        $access = array( 'name' => $site,
                         'type' => eZSiteAccess::TYPE_STATIC );

        $access = eZSiteAccess::change( $access );
        eZWebDAVContentBackend::appendLogEntry( __FUNCTION__ . '2:' . $site );

        eZDebugSetting::writeDebug( 'kernel-siteaccess', $access, 'current siteaccess' );

        // Clear/flush global database instance.
        $nullVar = null;
        eZDB::setInstance( $nullVar );
    }
489602
public function getSiteInstance()
    {
        return $this->site == null ? $this->site = new SiteImpl($this) : $this->site;
    }
854332
protected function updateSites($site, $target_env) {
    if (EnvironmentDetector::isAhOdeEnv($target_env)) {
      $this->updateOdeSites();
    }
    else {
      $this->updateAceSites($target_env);
    }
  }
604936
protected void onSiteChange(String site) {

        try {
            m_treeData.removeAllItems();
            CmsObject rootCms = OpenCms.initCmsObject(A_CmsUI.getCmsObject());
            rootCms.getRequestContext().setSiteRoot("");
            CmsResource siteRootResource = rootCms.readResource(site);

            m_treeData.initRoot(rootCms, siteRootResource);
            m_fileTree.expandItem(siteRootResource.getStructureId());
            m_siteRoot = site;
            updateRoot(rootCms, siteRootResource);
        } catch (CmsException e) {
            LOG.error(e.getLocalizedMessage(), e);
        }
    }
282659
public void addSite(String site) {
		if (siteModel.getIndexOf(site) < 0) {
			siteModel.addElement(site);
			if (currentSite == null) {
				// First site added, automatically select it
				siteModel.setSelectedItem(site);
			}
		}
	}
771156
protected function checkSiteAndAbort($site = null)
    {
        $site = $site ? $site : fp_env('ACACHA_FORGE_SITE');
        if (! $this->checkSite($site)) {
            $this->error('Site ' . $site . '  not valid');
            die();
        }
    }
972165
public function setHostFull(string $host) : self
    {
        $uri = new static($host);

        $this->uri['host'] = $uri->uri['host'];

        if (isset($uri->uri['scheme'])) {
            $this->uri['scheme'] = $uri->uri['scheme'];
        }

        if (isset($uri->uri['port'])) {
            $this->uri['port'] = $uri->uri['port'];
        }

        if (isset($uri->uri['user'])) {
            $this->uri['user'] = $uri->uri['user'];
        }

        if (isset($uri->uri['pass'])) {
            $this->uri['pass'] = $uri->uri['pass'];
        }

        return $this;
    }
112497
public function removeIdxSiteContents(Site $site, array $contents)
    {
        return $this->removeIdxSiteContentsByUids($site->getUid(), $this->getAClassContentUids($contents));
    }
235099
public function createForSite(SiteInterface $site)
    {
        $listRedirection = $this->redirectionRepository->findBySiteId($site->getSiteId());
        $siteLanguages = $site->getLanguages();
        $routes = array();

        foreach ($siteLanguages as $language) {
            $nodes = $this->nodeRepository->findPublishedByLanguageAndSiteId($language, $site->getSiteId());
            $routePattern = $this->nodeRepository->findAllRoutePattern($language, $site->getSiteId());
            $routePattern = $this->computeRoutePattern($routePattern);
            foreach ($nodes as $node) {
                $routes = array_merge($this->generateRoutesForNode($node, $site, $routePattern), $routes);
            }
        }

        foreach ($listRedirection as $redirection) {
            $routes = array_merge($this->generateRoutesForRedirection($redirection, $site), $routes);
        }

        return $routes;
    }
367124
private function LoadFrontendTranslations(Site $site)
    {
        $language = $site->GetLanguage()->GetCode();
        $frontendTranslations = PathUtil::FrontendBundleTranslationFile($this->BundleName(), $language);
        if (File::Exists($frontendTranslations))
        {
            require_once $frontendTranslations;
        }
        
    }
1354922
public function getSiteThemePagesTemplateConfig(Site $site)
    {
        $theme = $site->getTheme();

        $rcmThemesConfig = $this->getThemeConfig($theme);

        if (empty($rcmThemesConfig['pages'])) {
            throw new RuntimeException(
                'No theme config found for site and no default theme found'
            );
        }

        return $rcmThemesConfig['pages'];
    }
274005
public function orWhere(...$conditions) : self
    {
        $this->conditionalQueryBuilder->orWhere(
            ...$this->createConditionExpressions($conditions)
        );

        return $this;
    }
535829
public function setSite($site)
  {
    if ($site === '?' || $site === '') {
      $this->site = null;
    } elseif (strlen(preg_replace('/[^a-zA-Z]/', '', $site) < 2)) {
      // Some sites have been non-letter gibberish.
      $this->site = null;
    } else {
      $site = Util::foreignLettersToEnglishLetters($site);
      $site = Util::titleCaseIfCurrentlyAllCaps($site);
      $this->site = $site;
    }
  }