Returns the page tree url of a site
@param Site $site The site
@return string The url of the page tree
334647
protected function PageTreeUrl(Site $site)
    {
        $args = array('site' => $site->GetID());
        return BackendRouter::ModuleUrl(new PageTree(), $args);
    }
581921
function get_site_info( $site = null ) {
            $this->_logger->entrance();

            $switched = false;

            if ( is_null( $site ) ) {
                $url     = get_site_url();
                $name    = get_bloginfo( 'name' );
                $blog_id = null;
            } else {
                $blog_id = self::get_site_blog_id( $site );

                if ( get_current_blog_id() != $blog_id ) {
                    switch_to_blog( $blog_id );
                    $switched = true;
                }

                if ( $site instanceof WP_Site ) {
                    $url  = $site->siteurl;
                    $name = $site->blogname;
                } else {
                    $url  = get_site_url( $blog_id );
                    $name = get_bloginfo( 'name' );
                }
            }

            $info = array(
                'uid'      => $this->get_anonymous_id( $blog_id ),
                'url'      => $url,
                'title'    => $name,
                'language' => get_bloginfo( 'language' ),
                'charset'  => get_bloginfo( 'charset' ),
            );

            if ( is_numeric( $blog_id ) ) {
                $info['blog_id'] = $blog_id;
            }

            if ( $switched ) {
                restore_current_blog();
            }

            return $info;
        }
410288
public function hasSite(Site $site)
    {
        return $this->sites()
            ->where(SiteModel::ATTR_ID, '=', $site->getId())
            ->exists();
    }
640379
public function getCloningMapping(Site $site)
    {
        if (isset($this->cloningMapping[$site->getId()])) {
            return $this->cloningMapping[$site->getId()];
        }

        $q = $this->db
            ->select('node', 'n')
            ->fields('n', ['parent_nid', 'nid'])
            ->isNotNull('parent_nid')
            ->condition('site_id', $site->id)
            ->condition('status', NODE_PUBLISHED)
            ->orderBy('created', 'ASC')
        ;

        $mapping = [];

        foreach ($q->execute()->fetchAll() as $row) {
            if (isset($mapping[(int) $row->parent_nid])) {
                continue;
            }
            $mapping[(int) $row->parent_nid] = (int) $row->nid;
        }

        $this->cloningMapping[$site->getId()] = $mapping;

        return $mapping;
    }
28859
protected function getSitemapNodesFromSite(ReadSiteInterface $site)
    {
        $nodes = array();
        $nodesCollection = $this->nodeRepository->findPublishedByLanguageAndSiteId($site->getMainAlias()->getLanguage(), $site->getSiteId());

        if ($nodesCollection) {
            /** @var ReadNodeInterface $node */
            foreach ($nodesCollection as $node) {
                $nodes[] = $this->generateNodeInfos($node, $site);
            }
        }

        return $nodes;
    }
1236981
public function SiteTreeAsUL() {
        $html=$this->getSiteTreeFor($this->stat('tree_class'), null, 'Children', null);
        
        $this->extend('updateSiteTreeAsUL', $html);
        
        return $html;
    }
1014060
public function getSite()
    {
        $view = $this->getView();

        /** @var \Rcm\Entity\Site $site */
        $site = $view->site;

        /** Fix for non CMS pages */
        if (empty($site)) {
            $site = $this->currentSite;
        }

        return $site;
    }
1282662
protected function getCurrentSite()
    {
        if (!isset($this->data['site']) || $this->data['site'] === null) {
            return null;
        }

        return $this->siteRepository->findByIdentifier($this->data['site']);
    }
1271007
public function getHostBaseUrl($host = null)
    {
        $config = $this->getFullHost($host);

        return sprintf('%s://%s', $config['protocol'], $config['host']);
    }
288463
protected function getSite($siteId)
    {
        try {
            /** @var Site $site */
            $site = $this->getSiteRepo()->findOneBy(['siteId' => $siteId]);
        } catch (\Exception $e) {
            $site = null;
        }

        return $site;
    }
627700
private function get_site( $site_id ) {
		global $wpdb;

		// Load site data
		$site = $wpdb->get_row(
			$wpdb->prepare(
				"SELECT * FROM {$wpdb->blogs} WHERE blog_id = %d",
				$site_id
			)
		);

		if ( ! empty( $site ) ) {
			// Only care about domain and path which are set here
			return $site;
		}

		return false;
	}
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'];
    }
572768
public function newSiteAction(Site $site = null)
    {
        $sitePackages = $this->packageManager->getFilteredPackages('available', null, 'neos-site');
        $documentNodeTypes = $this->nodeTypeManager->getSubNodeTypes('Neos.Neos:Document', false);
        $this->view->assignMultiple([
            'sitePackages' => $sitePackages,
            'documentNodeTypes' => $documentNodeTypes,
            'site' => $site,
            'generatorServiceIsAvailable' => $this->packageManager->isPackageAvailable('Neos.SiteKickstarter')
        ]);
    }
666828
protected function getNotFoundPage(
        Site $site
    ) {
        $page = $this->findPage->__invoke(
            $site->getSiteId(),
            $site->getNotFoundPage(),
            PageTypes::NORMAL
        );

        if (empty($page)) {
            throw new PageNotFoundException(
                'No default page defined for 404 not found error'
            );
        }

        return $page;
    }
1353930
static function get_site_blog_id( &$site ) {
            return ( $site instanceof WP_Site ) ?
                $site->blog_id :
                ( is_object( $site ) && isset( $site->userblog_id ) ?
                    $site->userblog_id :
                    $site['blog_id'] );
        }
128795
public function andSiteIs(Site $site)
    {
        $suffix = $this->getSuffix();

        return $this->andWhere($this->getSectionAlias().'._site = :site'.$suffix)
                        ->setParameter('site'.$suffix, $site);
    }
577569
public static function site(string $site, string $uri = null): string
    {
        $otherSite = Application::getConfig('sites')->get($site);

        if ($otherSite === null) {
            throw new Exception("Unable to construct URL to site={$site}, site is not defined in configs/sites.php");
        }

        if ($uri === null || strlen($uri) === 0) {
            return $otherSite;
        } else {
            if ($uri[0] != '/') {
                $uri = '/' . $uri;
            }

            return $otherSite . $uri;
        }
    }