@param string $siteId

@Config\Route("/list/tree/{siteId}", name="open_orchestra_api_folder_list_tree")
@Config\Method({"GET"})

@return FacadeInterface
191817
public function listTreeFolderAction($siteId)
    {
        $folders = $this->get('open_orchestra_media.repository.media_folder')->findFolderTree($siteId);

        return $this->get('open_orchestra_api.transformer_manager')->transform('folder_tree', $folders);
    }
950015
public function createRootNode($siteId, $language, $name, $routePattern, $template)
    {
        $node = $this->initializeNode(NodeInterface::ROOT_PARENT_ID, $language, $siteId);
        $node->setTemplate($template);
        $node->setRoutePattern($routePattern);
        $node->setName($name);
        $node->setInMenu(true);
        $node->setInFooter(true);
        $node = $this->setVersionName($node);

        return $node;
    }
1054391
public function getActiveSiteTheme($siteId)
    {
        $qb = $this->getEntityManager()->createQueryBuilder();
        /** @var $query \Doctrine\ORM\Query */

        $query = $qb->select('e, t')
            ->from($this->_entity, 'e')
            ->innerJoin('e.themeId', 't')
            ->where('e.siteId = :id')
            ->andWhere('e.isActive = 1')
            ->setMaxResults(1)
            ->setParameter('id', $siteId)
            ->getQuery();

        /** @var $result \PageBuilder\Entity\Join\SiteTheme */
        $result = $query->getOneOrNullResult(AbstractQuery::HYDRATE_OBJECT);
        if ($result) {
            return $result->getThemeId();
        } else {
            return $result;
        }
    }
614949
public function actionGetRouteRules($siteId = null, $includeGlobal = true): Response
    {
        return $this->asJson(RouteMap::$plugin->routes->getRouteRules($siteId, $includeGlobal));
    }
55213
public function buildPagesResourceId(
        $siteId
    ) {
        return $this->resourceName->get(
            ResourceName::RESOURCE_SITES,
            $siteId,
            ResourceName::RESOURCE_PAGES
        );
    }
333812
public function get($instanceId)
    {
        $siteId = $this->getServiceLocator()->get(\Rcm\Service\CurrentSite::class)
            ->getSiteId();
        /** @var RcmUserService $rcmUserService */
        $rcmUserService = $this->serviceLocator->get(RcmUserService::class);

        /** @var ResourceName $resourceName */
        $resourceName = $this->getServiceLocator()->get(
            ResourceName::class
        );

        $allowed = $rcmUserService->isAllowed(
            $resourceName->get(ResourceName::RESOURCE_SITES, $siteId),
            'admin',
            \Rcm\Acl\ResourceProvider::class
        );

        if (!$allowed) {
            $this->getResponse()->setStatusCode(401);

            return $this->getResponse();
        }

        $routeMatch = $this->getEvent()->getRouteMatch();
        $pluginType = $routeMatch->getParam('pluginType');
        /**
         * @var $pluginMgr PluginManager
         */
        $pluginMgr = $this->getServiceLocator()
            ->get('Rcm\Service\PluginManager');
        $defaultInstanceCfg = $pluginMgr->getDefaultInstanceConfig($pluginType);
        if (!is_array($defaultInstanceCfg)) {
            return $this->notFoundAction();
        }

        if ($instanceId > 0) {
            try {
                $instanceConfig = $pluginMgr->getInstanceConfig($instanceId);
            } catch (PluginInstanceNotFoundException $e) {
                return $this->notFoundAction();
            }
        } else {
            $instanceConfig = $defaultInstanceCfg;
        }

        return new JsonModel(
            [
                'instanceConfig' => $instanceConfig,
                'defaultInstanceConfig' => $defaultInstanceCfg
            ]
        );
    }
671773
public function getSitePage(
        SiteEntity $site,
        $pageId
    ) {
        try {
            /** @var \Rcm\Entity\Page $page */
            $page = $this->findOneBy(
                [
                    'site' => $site,
                    'pageId' => $pageId
                ]
            );
        } catch (\Exception $e) {
            $page = null;
        }

        return $page;
    }
338756
public function findCacheById(int $id, int $siteId = null)
    {

        // Resolve siteId
        $siteId = SiteHelper::resolveSiteId($siteId);

        // Check if already in addToCache
        if ($this->isCachedById($id, $siteId)) {
            return $this->cacheById[$siteId][$id];
        }

        return null;
    }
334647
protected function PageTreeUrl(Site $site)
    {
        $args = array('site' => $site->GetID());
        return BackendRouter::ModuleUrl(new PageTree(), $args);
    }
402633
public function getSiteInfo($siteId)
    {
        /** @var \Doctrine\ORM\QueryBuilder $queryBuilder */
        $queryBuilder = $this->_em->createQueryBuilder();
        $queryBuilder->select(
            'partial site.{
                owner,
                theme,
                status,
                favIcon,
                loginPage,
                notAuthorizedPage,
                siteLayout,
                siteTitle,
                siteId
            },
            language,
            country'
        )->from(\Rcm\Entity\Site::class, 'site')
            ->join('site.country', 'country')
            ->join('site.language', 'language')
            ->where('site.siteId = :siteId')
            ->setParameter('siteId', $siteId);

        try {
            return $queryBuilder->getQuery()->getSingleResult(
                Query::HYDRATE_ARRAY
            );
        } catch (NoResultException $e) {
            return null;
        }
    }
278706
public function matchPath($alias, $siteId)
    {
        $nodeId = $this
            ->database
            ->query(
                "SELECT node_id FROM {ucms_seo_route} WHERE route = :route AND site_id = :site",
                [':route' => $alias, ':site' => $siteId]
            )
            ->fetchField()
        ;

        return $nodeId ? ((int)$nodeId) : null;
    }
223300
public function findOneByProductIdAndWebsite($productId, $websiteId)
    {

        // prepare the params
        $params = array(
            MemberNames::PRODUCT_ID => $productId,
            MemberNames::WEBSITE_ID => $websiteId
        );

        // load and return the product with the passed product/website ID
        $this->productWebsiteStmt->execute($params);
        return $this->productWebsiteStmt->fetch(\PDO::FETCH_ASSOC);
    }
758311
protected function buildSite($rootPageId)
    {
        $rootPageRecord = (array)BackendUtility::getRecord('pages', $rootPageId);

        $this->validateRootPageRecord($rootPageId, $rootPageRecord);
        $solrConfiguration = Util::getSolrConfigurationFromPageId($rootPageId);
        $domain = $this->getDomainFromConfigurationOrFallbackToDomainRecord($rootPageId);
        $siteHash = $this->getSiteHashForDomain($domain);
        $defaultLanguage = $this->getDefaultLanguage($rootPageId);
        $pageRepository = GeneralUtility::makeInstance(PagesRepository::class);

        return GeneralUtility::makeInstance(
            Site::class,
            /** @scrutinizer ignore-type */ $solrConfiguration,
            /** @scrutinizer ignore-type */ $rootPageRecord,
            /** @scrutinizer ignore-type */ $domain,
            /** @scrutinizer ignore-type */ $siteHash,
            /** @scrutinizer ignore-type */ $pageRepository,
            /** @scrutinizer ignore-type */ $defaultLanguage
        );
    }
515792
public function openOrchestraCss($themeId)
    {
        $tags = '';

        if (isset($this->themes[$themeId]) && isset($this->themes[$themeId]['stylesheets'])) {
            $stylesheets = $this->themes[$themeId]['stylesheets'];
            foreach ($stylesheets as $stylesheet) {
                $tags .= $this->getHtmlTag($stylesheet, self::FILETYPE_CSS);
            }
        }

        return $tags;
    }
836331
public function getDataBySiteIdAndPageId($siteId, $pageId)
	{
	    $select = $this->tableGateway->getSql()->select();
	     
	    $select->columns(array('*'));
	     
	    $select->where(array("s404_site_id" => $siteId, 's404_page_id' => $pageId));
	    $resultSet = $this->tableGateway->selectWith($select);
	     
	    return $resultSet;
	}
892079
public function worker($serverId, $siteId, $workerId)
    {
        return new Worker(
            $this->get("servers/$serverId/sites/$siteId/workers/$workerId")['worker']
            + ['server_id' => $serverId, 'site_id' => $siteId], $this
        );
    }
132358
protected function getChoices($siteId, $language)
    {
        $orderedNodes = $this->nodeRepository->findTreeNode($siteId, $language, NodeInterface::ROOT_NODE_ID);

        return $this->getHierarchicalChoices($orderedNodes);
    }