Return price index dimensions applicable for the given website.

@param integer $websiteId Website id.

@return array
@SuppressWarnings(PHPMD.ElseExpression)
192042
private function getPriceIndexDimensions($websiteId)
    {
        if (!array_key_exists($websiteId, $this->dimensionsByWebsite)) {
            $indexDimensions = $this->getAllPriceIndexDimensions();

            $relevantDimensions = [];
            foreach ($indexDimensions as $dimensions) {
                if (array_key_exists(WebsiteDimensionProvider::DIMENSION_NAME, $dimensions)) {
                    $websiteDimension = $dimensions[WebsiteDimensionProvider::DIMENSION_NAME];
                    if ((string) $websiteDimension->getValue() == $websiteId) {
                        $relevantDimensions[] = $dimensions;
                    }
                } else {
                    $relevantDimensions[] = $dimensions;
                }
            }

            $this->dimensionsByWebsite[$websiteId] = $relevantDimensions;
        }

        return $this->dimensionsByWebsite[$websiteId];
    }
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;
    }
1346426
public function extractResultVariableProperty($variableId)
    {
        $variableIds = explode('http://',$variableId);
        $parts = explode(static::PROPERTY_SEPARATOR, $variableIds[2]);

        $itemUri = $variableIds[0] . 'http://' . $parts[0];
        $propertyName = empty($parts[1]) ? 'RESPONSE' : $parts[1];

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

        return $site;
    }
754014
public function getConfigValue($key, $websiteId = null)
    {
        try {
            if (!$websiteId) {
                $websiteId = $this->storeManager->getWebsite()->getId();
            }

            return $this->scopeConfig->getValue('emartech/emarsys/config/' . $key, 'websites', $websiteId);
        } catch (\Exception $e) {
            return '';
        }
    }
1277345
public function getActiveTheme($siteId)
    {
        $manager = $this->getEntityManager();
        $query   = $manager
            ->createQueryBuilder()
            ->select('t,s')
            ->from($this->_entity, 't')
            ->innerJoin('t.siteThemes', 's')
            ->where('s.siteId = :id')
            ->andWhere('s.isActive = 1')
            ->setParameter(':id', $siteId)
            ->setMaxResults(1)
            ->getQuery();

        try {
            return $query->getSingleResult(AbstractQuery::HYDRATE_OBJECT);
        } catch (NoResultException $e) {
            return false;
        } catch (NonUniqueResultException $e) {
            return false;
        }
    }
487512
public function generatePerimeter($siteId)
    {
        $treeNodes = $this->nodeRepository->findTreeNode(
            $siteId,
            $this->contextManager->getSiteContributionLanguage(),
            NodeInterface::ROOT_PARENT_ID
        );

        return $this->generateTreePerimeter($treeNodes);
    }
1010581
public function getRedirectList($siteId)
    {
        try {
            $result = $this->getQuery($siteId)->getResult();
        } catch (NoResultException $e) {
            $result = [];
        }

        return $result;
    }
53516
public function getSize($id = 0)
    {
        if ($id) {
            return $this->_protocol->fetch('RFC822.SIZE', $id);
        }
        return $this->_protocol->fetch('RFC822.SIZE', 1, INF);
    }
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]
        );
    }
1204762
public function getValues(string $id): array
    {
        $data = Internal\Data::getValue('bearcms/themes/theme/' . md5($id) . '.json');
        if ($data !== null) {
            $data = json_decode($data, true);
            if (isset($data['options'])) {
                return $data['options'];
            }
        }
        return [];
    }
23371
public function getForFrontend($pageId)
    {
        return $this->find()
            ->contain(['Current', 'Attributes'])
            ->formatResults([$this, 'formatAttributes'])
            ->where([$this->aliasField('id') => $pageId])
            ->first();
    }
692441
public function getBrandAttributeByWebsiteId($websiteId)
    {
        return $this->getWebsiteConfig(
            \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_SYNC_DATA_FIELDS_BRAND_ATTRIBUTE,
            $websiteId
        );
    }
1315122
public function getBlogUrl($blogId)
    {
        if (isset($this->blogUrl[$blogId])) {

            return $this->blogUrl[$blogId];

        } else {

            $url = appSetting('url', 'blog-' . $blogId);
            $url = $url ? $url : 'blog/';
            $url = site_url($url);

            $this->blogUrl[$blogId] = $url;

            return $this->blogUrl[$blogId];
        }
    }
876733
public function getPushIntegrationCode($websiteID)
    {
        if (empty($websiteID)) {
            return $this->handleError('Empty website id');
        }

        $requestResult = $this->sendRequest('/push/websites/' . $websiteID . '/code');

        return $this->handleResult($requestResult);
    }
1234487
public function getPvByProductAndStock($productId, $stockId)
    {
        /* aliases and tables */
        $asStockItem = 'csi';
        $asPv = 'ppsi';
        $tblStockItem = [$asStockItem => $this->resource->getTableName(Cfg::ENTITY_MAGE_CATALOGINVENTORY_STOCK_ITEM)];
        $tblPv = [$asPv => $this->resource->getTableName(Entity::ENTITY_NAME)];
        /* SELECT FROM cataloginventory_stock_item */
        $query = $this->conn->select();
        $cols = [];
        $query->from($tblStockItem, $cols);
        /* LEFT JOIN prxgt_pv_stock_item */
        $on = $asPv . '.' . Entity::A_ITEM_REF . '=' . $asStockItem . '.' . Cfg::E_CATINV_STOCK_ITEM_A_ITEM_ID;
        $cols = [Entity::A_PV];
        $query->joinLeft($tblPv, $on, $cols);
        /* WHERE */
        $where = $asStockItem . '.' . Cfg::E_CATINV_STOCK_ITEM_A_PROD_ID . '=' . (int)$productId;
        $where .= ' AND ' . $asStockItem . '.' . Cfg::E_CATINV_STOCK_ITEM_A_STOCK_ID . '=' . (int)$stockId;
        $query->where($where);
        /* fetch data */
        $result = $this->conn->fetchOne($query);
        return $result;
    }
215769
public function findPageUidsWithContentsFromPid(int $pageId) : array
    {
        $queryBuilder = $this->getQueryBuilder();
        $queryBuilder->getRestrictions()->removeAll();
        $queryBuilder->getRestrictions()->add(GeneralUtility::makeInstance(DeletedRestriction::class));

        $queryBuilder
            ->select('uid')
            ->from($this->table)
            ->add('where',
                $queryBuilder->expr()->eq('content_from_pid', $queryBuilder->createNamedParameter($pageId, \PDO::PARAM_INT))
            );

        $this->addDefaultLanguageUidConstraint($queryBuilder);

        return $queryBuilder->execute()->fetchAll();
    }