Removes page with no contentset for $site.

@param Site                  $site

@deprecated
503072
public function removeEmptyPages(Site $site)
    {
        $q = $this->createQueryBuilder('p')
            ->select()
            ->andWhere('p._contentset IS NULL')
            ->andWhere('p._site = :site')
            ->orderBy('p._leftnode', 'desc')
            ->setParameter('site', $site);

        foreach ($q->getQuery()->execute() as $page) {
            $this->deletePage($page);
        }
    }
624650
public function addSiteFilter($site)
    {
        if ($site instanceof Site) {
            $site = $site->getUid();
        }

        if (!empty($site)) {
            $this->andWhere(
                'cc._uid IN (SELECT i.content_uid FROM BackBee\ClassContent\Indexes\IdxSiteContent i WHERE i.site_uid = :site_uid)'
            )->setParameter('site_uid', $site);
        }
    }
351250
public function viewAction(Site $site)
    {
        $requester = user_load($site->uid);
        if (!$requester) {
            $requester = drupal_anonymous_user();
        }

        $template = null;
        if ($site->template_id) {
            try {
                $template = $this->getSiteManager()->getStorage()->findOne($site->template_id);
                $template = l($template->title, 'admin/dashboard/site/' . $template->id);
            } catch (\Exception $e) {
                $template = '<span class="text-muted>' . t("Template does not exist anymore") . '</span>';
            }
        } else {
            $template = '';
        }

        $states = SiteState::getList();

        $uri = 'http://' . $site->http_host;

        $table = $this->createAdminTable('ucms_site_details', ['site' => $site])
            ->addHeader(t("Identification"))
            ->addRow(t("HTTP hostname"), l($uri, $uri))
            ->addRow(t("State"), t($states[$site->state]))
            ->addRow(t("Title"), check_plain($site->title))
            ->addRow(t("Created at"), format_date($site->ts_created->getTimestamp()))
            ->addRow(t("Lastest update"), format_date($site->ts_changed->getTimestamp()))
            ->addRow(t("Requester"), check_plain(format_username($requester)))
            ->addHeader(t("Description"))
            ->addRow(t("Description"), check_markup($site->title_admin))
            ->addRow(t("Replaces"), check_markup($site->replacement_of))
            ->addRow(t("HTTP redirections"), check_markup($site->http_redirects))
            ->addHeader(t("Display information"))
            ->addRow(t("Theme"), check_plain($site->theme))
            ->addRow(t("Is a template"), $site->is_template ? '<strong>' . t("yes") . '</strong>' : t("No"))
        ;

        if ($template) {
            $table->addRow(t("Site template"), $template);
        }

        $this->addArbitraryAttributesToTable($table, $site->getAttributes());

        return $table->render();
    }
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();
	}
404437
def cache_delsite(site_id):
	''
	mkey = getkey(T_META, site_id)
	tmp = cache.get(mkey)
	if not tmp:
		return
	for tkey in tmp:
		cache.delete(tkey)
	cache.delete(mkey)
155511
public function setSite($site)
    {
        if ($site === null) {
            $this->siteId = null;
            $this->site = null;

            return;
        }
        $this->siteId = $site->getSiteId();

        $this->site = $site;
    }
474280
public function setSite($site = null)
    {
        $this->site = null;

        if (($site = SiteHelper::resolve($site)) === null) {
            $this->site = $this->siteId = null;
        } else {
            $this->siteId = $site->id;
            $this->site = $site;
        }

        return $this;
    }
1134288
protected function cleanupDirectory()
    {
        if (empty($this->sitemapDir)) {
            throw new \Exception('Basedir not set');
        }

        $fullPath = PATH_site . '/' . $this->sitemapDir;

        if (!is_dir($fullPath)) {
            Typo3GeneralUtility::mkdir($fullPath);
        }

        foreach (new \DirectoryIterator($fullPath) as $file) {
            if ($file->isFile() && !$file->isDot()) {
                $fileName = $file->getFilename();
                unlink($fullPath . '/' . $fileName);
            }
        }
    }
700672
public function cleanup( array $siteids )
	{
		$context = $this->_getContext();
		$config = $context->getConfig();
		$search = $this->createSearch();

		$path = 'classes/catalog/manager/submanagers';
		foreach( $config->get( $path, array( 'list' ) ) as $domain ) {
			$this->getSubManager( $domain )->cleanup( $siteids );
		}

		$dbm = $context->getDatabaseManager();
		$dbname = $this->_getResourceName();
		$conn = $dbm->acquire( $dbname );

		try
		{
			$path = 'mshop/catalog/manager/default/item/delete';
			$sql = $config->get( $path, $path );

			$types = array( 'siteid' => MW_DB_Statement_Abstract::PARAM_STR );
			$translations = array( 'siteid' => '"siteid"' );

			$search->setConditions( $search->compare( '==', 'siteid', $siteids ) );
			$sql = str_replace( ':siteid', $search->getConditionString( $types, $translations ), $sql );

			$stmt = $conn->create( $sql );
			$stmt->bind( 1, 0, MW_DB_Statement_Abstract::PARAM_INT );
			$stmt->bind( 2, 0x7FFFFFFF, MW_DB_Statement_Abstract::PARAM_INT );
			$stmt->execute()->finish();

			$dbm->release( $conn, $dbname );
		}
		catch( Exception $e )
		{
			$dbm->release( $conn, $dbname );
			throw $e;
		}
	}
435861
public function activateSiteAction(Site $site)
    {
        $site->setState($site::STATE_ONLINE);
        $this->siteRepository->update($site);
        $this->addFlashMessage('The site "%s" has been activated.', 'Site activated', Message::SEVERITY_OK, [htmlspecialchars($site->getName())], 1412372881);
        $this->unsetLastVisitedNodeAndRedirect('index');
    }
34906
public function flushErrorsBySite(Site $site) : int
    {
        $queryBuilder = $this->getQueryBuilder();
        $affectedRows = $this->getPreparedFlushErrorQuery($queryBuilder)
            ->andWhere(
                $queryBuilder->expr()->eq('root', (int)$site->getRootPageId())
            )
            ->execute();
        return $affectedRows;
    }
1026604
def remove_site (site)
      return nil unless @sites.map{|s| s[:name]}.include? site
      @sites.reject!{|s| s[:name] == site}
      @need_to_update = true
    end
652749
public function setSite(\BackBee\Site\Site $site = null)
    {
        $this->_site = $site;

        return $this;
    }
770695
public static function setSites($sites)
    {
        self::triggerSetSitesEvent($sites);

        foreach ($sites as $idsite => $site) {
            self::setSiteFromArray($idsite, $site);
        }
    }
1144405
def remove_site(name):
    '''
    
    '''

    ret = {'name': name,
           'changes': {},
           'result': None,
           'comment': ''}

    current_sites = __salt__['win_iis.list_sites']()

    if name not in current_sites:
        ret['comment'] = 'Site has already been removed: {0}'.format(name)
        ret['result'] = True
    elif __opts__['test']:
        ret['comment'] = 'Site will be removed: {0}'.format(name)
        ret['changes'] = {'old': name,
                          'new': None}
    else:
        ret['comment'] = 'Removed site: {0}'.format(name)
        ret['changes'] = {'old': name,
                          'new': None}
        ret['result'] = __salt__['win_iis.remove_site'](name)
    return ret
465707
public function removeWebmasters(Site $site, $userIdList)
    {
        $this->removeUsersWithRole($site, $userIdList, Access::ROLE_WEBMASTER);
    }
112497
public function removeIdxSiteContents(Site $site, array $contents)
    {
        return $this->removeIdxSiteContentsByUids($site->getUid(), $this->getAClassContentUids($contents));
    }