Generate perimeter

@param string $siteId
@return array
487512
public function generatePerimeter($siteId)
    {
        $treeNodes = $this->nodeRepository->findTreeNode(
            $siteId,
            $this->contextManager->getSiteContributionLanguage(),
            NodeInterface::ROOT_PARENT_ID
        );

        return $this->generateTreePerimeter($treeNodes);
    }
197829
private function getPriceIndexDimensionsTables($websiteId)
    {
        $tables = [];

        $indexDimensions = $this->getPriceIndexDimensions($websiteId);
        foreach ($indexDimensions as $dimensions) {
            $tables[] = $this->priceTableResolver->resolve('catalog_product_index_price', $dimensions);
        }

        return $tables;
    }
55213
public function buildPagesResourceId(
        $siteId
    ) {
        return $this->resourceName->get(
            ResourceName::RESOURCE_SITES,
            $siteId,
            ResourceName::RESOURCE_PAGES
        );
    }
655769
public function deleteAction($siteId)
    {
        $site = $this->get('open_orchestra_model.repository.site')->findOneBySiteId($siteId);
        $this->denyAccessUnlessGranted(ContributionActionInterface::DELETE, $site);

        if ($site instanceof SiteInterface) {
            $site->setDeleted(true);
            $this->dispatchEvent(SiteEvents::SITE_DELETE, new SiteEvent($site));
            $this->get('object_manager')->flush();
        }

        return array();
    }
1210871
protected function generateFilterMediaPerimeter(array $perimeterFolderIds)
    {
        $folderIds = array();

        foreach ($perimeterFolderIds as $key => $folderId) {
            $folderIds[] = new \MongoId($folderId);
        }

        return array('mediaFolder.$id' => array('$in' => $folderIds));
    }
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;
	}
403594
public function getPerimeterConfiguration($siteId)
    {
        $treeNodes = $this->nodeRepository->findTreeNode(
            $siteId,
            $this->contextManager->getSiteContributionLanguage(),
            NodeInterface::ROOT_PARENT_ID
        );

        return $this->getTreePerimeterConfiguration($treeNodes);
    }
1181932
protected function siteResourceMapper($resourceId)
    {
        if (!$this->resourceName->isSitesResourceId($resourceId)) {
            return null;
        }

        $sitesResourceId = $this->resourceName->get(self::RESOURCE_SITES);

        $return = [
            'resourceId' => $resourceId,
            'parentResourceId' => $sitesResourceId,
        ];

        return array_merge(
            $this->resources[self::RESOURCE_SITES],
            $return
        );
    }
242953
public static function getChildPageIds($pageId)
    {
        if (empty(self::$preloaded_page_children)) {
            foreach (static::preloadArray() as $key => $page) {
                if (!isset(self::$preloaded_page_children[$page->parent])) {
                    self::$preloaded_page_children[$page->parent] = [];
                }
                self::$preloaded_page_children[$page->parent][] = $page->id;
            }
        }
        return !empty(self::$preloaded_page_children[$pageId]) ? self::$preloaded_page_children[$pageId] : [];
    }
132358
protected function getChoices($siteId, $language)
    {
        $orderedNodes = $this->nodeRepository->findTreeNode($siteId, $language, NodeInterface::ROOT_NODE_ID);

        return $this->getHierarchicalChoices($orderedNodes);
    }
901889
public static function get_blockids_from_courseid($courseid) {
        global $DB;

        // Get the context of the course
        $contextid = context_course::instance($courseid)->id;

        // Get all the block instances which parentcontextid is the course contextid
        $blockids = array();
        $instances = $DB->get_records('block_instances', array('parentcontextid' => $contextid), '', 'id');
        foreach ($instances as $instance) {
            $blockids[] = $instance->id;
        }
        return $blockids;
    }
260685
public function getPageRevisionList($siteId, $pageName, $pageType)
    {
        $publishedQueryBuilder = $this->_em->createQueryBuilder();

        $publishedQueryBuilder->select('PARTIAL page.{pageId}, published, staged ')
            ->from(\Rcm\Entity\Page::class, 'page')
            ->leftjoin('page.publishedRevision', 'published')
            ->leftjoin('page.stagedRevision', 'staged')
            ->where('page.site = :siteId')
            ->andWhere('page.name = :pageName')
            ->andWhere('page.pageType = :pageType')
            ->setParameter('siteId', $siteId)
            ->setParameter('pageName', $pageName)
            ->setParameter('pageType', $pageType);

        $lastDraftQueryBuilder = $this->getRevisionQuery(
            $siteId,
            $pageName,
            $pageType
        );

        $result = $publishedQueryBuilder->getQuery()->getSingleResult(
            \Doctrine\ORM\Query::HYDRATE_ARRAY
        );

        try {
            $lastDraft = $lastDraftQueryBuilder->setMaxResults(1)->getSingleResult(
                \Doctrine\ORM\Query::HYDRATE_ARRAY
            );
            $lastDraft = array_values($lastDraft['revisions']);
        } catch (NoResultException $e) {
            $lastDraft = [0 => null];
        }

        $result['lastDraft'] = $lastDraft[0];

        if ($result['lastDraft']['revisionId']
            == $result['stagedRevision']['revisionId']
        ) {
            $result['lastDraft'] = null;
        }

        return $result;
    }
667481
public function getSiteWidePluginsList($siteId)
    {
        $queryBuilder = $this->_em->createQueryBuilder();
        $queryBuilder->select('partial site.{siteId}, plugins')
            ->from(\Rcm\Entity\Site::class, 'site')
            ->join('site.sitePlugins', 'plugins')
            ->where('site.siteId = :siteId')
            ->setParameter('siteId', $siteId);

        $result = $queryBuilder->getQuery()->getSingleResult(
            \Doctrine\ORM\Query::HYDRATE_ARRAY
        );

        if (empty($result) || empty($result['sitePlugins'])) {
            return [];
        }

        return $result['sitePlugins'];
    }
1361655
public function getPathAlias($nodeId, $siteId)
    {
        $route = $this
            ->database
            ->query(
                "SELECT route, is_outdated FROM {ucms_seo_route} WHERE node_id = :node AND site_id = :site",
                [':node' => $nodeId, ':site' => $siteId]
            )
            ->fetch()
        ;

        if (!$route || $route->is_outdated) {
            return $this->computeAndStorePathAlias($nodeId, $siteId, ($route ? $route->route : null));
        } else {
            return $route->route;
        }
    }
560724
protected function getSitePagesResourceId($siteId)
    {
        /** @var ResourceName $resourceName */
        $resourceName = $this->getServiceLocator()->get(
            ResourceName::class
        );

        return $resourceName->get(
            ResourceName::RESOURCE_SITES,
            $siteId,
            ResourceName::RESOURCE_PAGES
        );
    }
620080
public function getRouteRules($siteId = null, $includeGlobal = true): array
    {
        $globalRules = $includeGlobal === true ? $this->getDbRoutes('global') : [];

        $siteRoutes = $this->getDbRoutes($siteId);

        $rules = array_merge(
            Craft::$app->getRoutes()->getConfigFileRoutes(),
            $globalRules,
            $siteRoutes
        );

        return $rules;
    }
853246
public function certificates($serverId, $siteId)
    {
        return $this->transformCollection(
            $this->get("servers/$serverId/sites/$siteId/certificates")['certificates'],
            Certificate::class,
            ['server_id' => $serverId, 'site_id' => $siteId]
        );
    }