Set preloaded site

@param Site $site
188292
public function setSite(Site $site)
    {
        if ($this->site || $site->getId() !== $this->getSiteId()) {
            throw new \LogicException("this object is not really immutable, but it should be, site is already set anyway");
        }

        $this->site = $site;
    }
1095032
public function setWebsite($website)
	{
		if ( $website == $this->getWebsite() ) { return; }

		$pattern = '#^([a-z]+://)?[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]+)+(:[0-9]+)?(/.*)?$#';

		if( $website !== '' && preg_match( $pattern, $website ) !== 1 ) {
			throw new MShop_Exception( sprintf( 'Invalid web site URL "%1$s"', $website ) );
		}

		$this->_values['website'] = (string) $website;
		$this->setModified();
	}
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);
		}
	}
369545
public function createEntity(Site $site = null)
    {
        if (!$site) {
            $site = new Site($this->config);
        } else {
            $site->updateSiteConfigRepository($this->config);
        }
        return $site;
    }
1328893
public void setSite(String v) {
    if (Event_Type.featOkTst && ((Event_Type)jcasType).casFeat_site == null)
      jcasType.jcas.throwFeatMissing("site", "ch.epfl.bbp.uima.genia.Event");
    jcasType.ll_cas.ll_setStringValue(addr, ((Event_Type)jcasType).casFeatCode_site, v);}
28032
public void setSiteRoot(String siteRoot) {

        if (siteRoot != null) {
            siteRoot = siteRoot.replaceFirst("/$", "");
        }
        m_siteRoot = siteRoot;
    }
1005833
public function onSuccess($locale, SiteInterface $site)
    {
        $this->siteManager->save();
        $this->eventDispatcher->dispatch(SiteEvents::EDIT_SUCCESS, new SiteEvent($locale, $site));

        $alert = $this->alertManager->create();
        $alert->addSuccess($this->translator->trans('success.site_save', array(), 'SilvestraSite'));
        $this->alertManager->setFlashAlert($alert);
    }
97804
public function onSiteCreate(SiteEvent $event)
    {
        $site = $event->getSite();

        $this->service->getNotificationService()->subscribe('site', $site->getId(), $site->getOwnerUserId());
    }
155039
private function SiteHostCondition(Site $site)
    {
        $siteUrl = $site->GetUrl();
        $host = parse_url($siteUrl, PHP_URL_HOST);
        return new RewriteCondition(new Variable(ServerVariable::HttpHost()), $host);
    }
774294
private function getCurrentSite(Site $site = null)
    {
        if (null !== $site) {
            return $site;
        }

        if (null !== $this->application) {
            return $this->application->getSite();
        }

        return null;
    }
268822
public void setWebsite(String website) {
    if(website != null) {
      website = website.trim();
    }
    this.website = website;
  }
453020
private function parseSiteSettings(\DOMNode $site) {

		if(is_null($this->site)) {

			$this->site = new \stdClass;
			$this->site->use_nice_uris = FALSE;

		}

		foreach($site->childNodes as $node) {

			if($node->nodeType !== XML_ELEMENT_NODE) {
				continue;
			}

			$v = trim($node->nodeValue);
			$k = $node->nodeName;

			switch ($k) {

				case 'locales':
					if(!isset($this->site->locales)) {
						$this->site->locales = [];
					}

					foreach($node->getElementsByTagName('locale') as $locale) {
						$loc = $locale->getAttribute('value');
						if($loc && !in_array($loc, $this->site->locales)) {
							$this->site->locales[] = $loc;
						}
						if($loc && $locale->getAttribute('default') === '1') {
							$this->site->default_locale = $loc;
						}
					}

					break;

				case 'site->use_nice_uris':
					if($v === '1') {
						$this->site->use_nice_uris = TRUE;
					}
					break;

				default:
					$this->site->$k = $v;
			}

		}

	}
76700
private function _set_account( FS_User $user, FS_Site $site, $plans = false ) {
            $site->user_id = $user->id;

            $this->_site = $site;
            $this->_user = $user;
            if ( false !== $plans ) {
                $this->_plans = $plans;
            }

            $this->send_install_update();

            $this->_store_account();

        }
361600
public function deleteSiteAction(Site $site)
    {
        $this->siteService->pruneSite($site);
        $this->addFlashMessage('The site "%s" has been deleted.', 'Site deleted', Message::SEVERITY_OK, [htmlspecialchars($site->getName())], 1412372689);
        $this->unsetLastVisitedNodeAndRedirect('index');
    }
196277
public function tasks($site)
    {
        $variables = array(
            'site' => $site,
        );
        $request = $this->get(array('{+base_path}/sites/{site}/tasks.json', $variables));
        return new Response\Tasks($request);
    }
1312034
public function setConfigPerSite($v)
    {
        $properties = $this->getProperty();
        $properties['config_per_site'] = (boolean) $v;
        $this->getConfig()->setSection('bundle', $properties, true);

        return $this;
    }
1318195
private function SiteFolderCondition(Site $site)
    {
        $siteUrl = $site->GetUrl();       
        $siteFolder = parse_url($siteUrl, PHP_URL_PATH);
        if ($siteFolder != '' && $siteFolder != '/')
        {
            return new RewriteCondition(new Variable(ServerVariable::RequestUri()), '^' . rtrim($siteFolder, '/') . '/');
        }
        else
        {
            return new RewriteCondition(new Variable(ServerVariable::RequestUri()), '^/');
        } 
        return null;
    }