@param $siteId

@return array
18757
public function getSettingBySiteId($siteId)
    {
        /** @var $query QueryBuilder */
        $params = ['dataSource' => $siteId];
        $qb     = $this->getFindByQueryBuilder($params, null, 'e', ['id','settingValue']);
        $qb->addSelect('partial k.{id,code,defaultValue}')
            ->innerJoin('e.settingKey', 'k');

        return $qb->getQuery()->getResult();
    }
606982
public function findAllowedSites($siteId)
    {
        $qb = $this->createQueryBuilder();
        $qb->field('allowedSites')->in(array($siteId));

        return $qb->getQuery()->execute();
    }
560724
protected function getSitePagesResourceId($siteId)
    {
        /** @var ResourceName $resourceName */
        $resourceName = $this->getServiceLocator()->get(
            ResourceName::class
        );

        return $resourceName->get(
            ResourceName::RESOURCE_SITES,
            $siteId,
            ResourceName::RESOURCE_PAGES
        );
    }
288463
protected function getSite($siteId)
    {
        try {
            /** @var Site $site */
            $site = $this->getSiteRepo()->findOneBy(['siteId' => $siteId]);
        } catch (\Exception $e) {
            $site = null;
        }

        return $site;
    }
439217
public function nextVenues($venueId)
    {

        $resource = '/venues/' . $venueId . '/nextvenues';
        $response = $this->makeApiRequest($resource);

        if(property_exists($response, 'nextVenues')) {
            return $response->nextVenues->items;
        }

        return array();

    }
635369
protected function isCachedById(int $id, int $siteId = null)
    {
        // Resolve siteId
        $siteId = SiteHelper::resolveSiteId($siteId);

        if (!isset($this->cacheById[$siteId])) {
            $this->cacheById[$siteId] = [];
        }

        return array_key_exists($id, $this->cacheById[$siteId]);
    }
517072
protected function getSite($sites, $site_id)
    {
        $site_found = collect($sites)->filter(function ($site) use ($site_id) {
            return $site->id === $site_id;
        })->first();

        if ($site_found) {
            return $site_found;
        }
        return null;
    }
938247
public function adminAction($siteId = null)
    {
        $contextManager = $this->get('open_orchestra_backoffice.context_backoffice_manager');

        if ($siteId) {
            $site = $this->get('open_orchestra_model.repository.site')->findOneBySiteId($siteId);
            $contextManager->setSite($site->getSiteId(), $site->getName(), $site->getDefaultLanguage(), $site->getLanguages());
        }
        $clientConfiguration = $this->get('open_orchestra_backoffice.manager.client_configuration');

        return $this->render('OpenOrchestraBackofficeBundle::layout.html.twig' , array(
            'clientConfiguration' => $clientConfiguration->getClientConfiguration()
        ));
    }
368784
public function getCategoryUrls(string $category, array $criteria = [], $siteId = null): array
    {

        $criteria = array_merge([
            'group' => $category,
        ], $criteria);

        return $this->getElementUrls(Category::class, $criteria, $siteId);
    }
1204352
public function findBySite($siteId)
    {
        $qb = $this->createQueryBuilder();
        $qb->field('siteId')->equals($siteId);

        return $qb;
    }
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);
    }
1082244
public function links($venueId)
    {

        $resource = '/venues/' . $venueId . '/links';
        $response = $this->makeApiRequest($resource);

        if(property_exists($response, 'links')) {
            return $response->links->items;
        }

        return array();

    }
912243
private function findWebsiteIdsInTimezoneWithNewDay($websiteIds)
    {
        $timezones = $this->getTimezonesHavingNewDaySinceLastRun();
        $websiteDayHasFinishedSinceLastRun = APISitesManager::getInstance()->getSitesIdFromTimezones($timezones);
        $websiteDayHasFinishedSinceLastRun = array_intersect($websiteDayHasFinishedSinceLastRun, $websiteIds);
        $this->websiteDayHasFinishedSinceLastRun = $websiteDayHasFinishedSinceLastRun;

        if (count($websiteDayHasFinishedSinceLastRun) > 0) {
            $ids = !empty($websiteDayHasFinishedSinceLastRun) ? ", IDs: " . implode(", ", $websiteDayHasFinishedSinceLastRun) : "";
            $this->logger->info("- Will process " . count($websiteDayHasFinishedSinceLastRun)
                . " other websites because the last time they were archived was on a different day (in the website's timezone) "
                . $ids);
        }

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

        return $this->generateTreePerimeter($treeNodes);
    }
1176150
public function getSiteInfo(int $appId) : array
    {
        Assert::that($appId)->greaterThan(0, 'The $appId has to be positive');
        return (array)$this->master->doRequest(
            'GET',
            sprintf(
                '/admin/WEBAPI/Endpoints/v1_0/PluginService/{KEY}/SiteInfo/%s',
                $appId
            )
        );
    }
1257342
public function selectTypeAction($siteId = null)
    {
        $contentTypes = $this->get('opifer.content.content_type_manager')->getRepository()->findAll();

        $layouts = $this->get('opifer.content.content_manager')->getRepository()->findBy(['layout' => true]);

        if (!$contentTypes) {
            return $this->redirectToRoute('opifer_content_content_create');
        }

        return $this->render($this->getParameter('opifer_content.content_select_type'), [
            'content_types' => $contentTypes,
            'site_id' => $siteId,
            'layouts' => $layouts
        ]);
    }
1067701
public function getSectionUrls(string $section, array $criteria = [], $siteId = null): array
    {
        $criteria = array_merge([
            'section' => $section,
            'status' => 'enabled',
        ], $criteria);

        return $this->getElementUrls(Entry::class, $criteria, $siteId);
    }