@param int|null $storeId

@return mixed
967699
public function getConfigDataWsUserName($storeId = null)
    {
        if ($this->getConfigDataDemoMode($storeId)) {
            return $this->getConfigData('ws_username_test', null, $storeId);
        }

        return $this->getConfigData('ws_username_live', null, $storeId);
    }
1147333
public function isOnlySubscribersForAC($storeId)
    {
        $value = $this->scopeConfig->isSetFlag(
            \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_CONTENT_ALLOW_NON_SUBSCRIBERS,
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
            $storeId
        );
        return ($value) ? false : true;
    }
499358
public function getExpansions($storeId)
    {
        $connection = $this->getConnection();
        $select     = $this->getBaseSelect($storeId, ThesaurusInterface::TYPE_EXPANSION);

        $select->join(
            ['expanded_terms' => $this->getTable(ThesaurusInterface::REFERENCE_TABLE_NAME)],
            'expanded_terms.term_id = terms.term_id AND expanded_terms.thesaurus_id = terms.thesaurus_id',
            []
        );

        $select->columns(['terms' => new \Zend_Db_Expr('CONCAT(expanded_terms.term, " => " ,GROUP_CONCAT(terms.term))')]);

        return $connection->fetchCol($select);
    }
603231
private function getMaxCountCacheableSearchTerms(int $storeId)
    {
        return $this->scopeConfig->getValue(
            PopularSearchTerms::XML_PATH_MAX_COUNT_CACHEABLE_SEARCH_TERMS,
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
            $storeId
        );
    }
522141
public function fetchData($storeId = Store::DEFAULT_STORE_ID, $categoryIds = [])
    {
        $connection = $this->getConnection('read');
        $table = $this->getTable('url_rewrite');
        $select = $connection
            ->select()
            ->from($table, ['entity_id', 'request_path'])
            ->where('entity_type = ?', 'category')
            ->where('redirect_type = ?', 0)
            ->where('store_id = ?', $storeId)
            ->where('entity_id IN (' . implode(',', $categoryIds) . ')');

        return $connection->fetchPairs($select);
    }
1202084
private function loadChildAttributes(int $storeId)
    {
        if ($this->childEntities->count() === 0) {
            return;
        }

        $iterator = $this->eavIteratorFactory->create(['entityCode' => Product::ENTITY, 'attributes' => []]);
        $iterator->setEntityIds($this->childEntities->getIds());
        $iterator->setStoreId($storeId);
        $this->iteratorInitializer->initializeAttributes($iterator);

        foreach ($iterator as $childData) {
            $childId = (int) $childData['entity_id'];
            $childEntity = $this->childEntities->get($childId);
            $childEntity->setFromArray($childData);
        }
    }
82184
public function getByProductIds(array $productIds, $storeId)
    {
        $searchQueryTable = $this->getTable('search_query');
        $select = $this->getBaseSelect()
            ->joinInner($searchQueryTable, "main_table.query_id = {$searchQueryTable}.query_id", [])
            ->where('product_id IN(?)', $productIds)
            ->where('store_id = ?', $storeId)
            ->columns(['product_id', 'query_id', 'position', 'is_blacklisted']);

        return $this->getConnection()->fetchAll($select);
    }
189600
private function getEncryptedKey($path, $storeId = null)
    {
        //Get management key
        $key =  $this->getScopeConfig()->getValue(
            $path,
            ScopeInterface::SCOPE_STORE,
            $storeId
        );

        //Decrypt management key
        $key = $this->encryptor->decrypt($key);
        return $key;
    }
1045564
protected function getTree($storeIds)
    {
        $filter = implode(',', $storeIds);
        if (isset($this->storeTrees[$filter])) {
            return $this->storeTrees[$filter];
        }

        $data = [];
        $stores = $this->storeManager->getStores(true);
        foreach ($stores as $store) {
            if (in_array($store->getId(), $storeIds)) {
                $data[$store->getId()] = $this->getStoreOptions($store);
            } elseif ($filter == 0) {
                $data[$store->getId()] = $this->getStoreOptions($store);
            }
        }

        $this->storeTrees[$filter] = $data;

        return $this->storeTrees[$filter];
    }
860306
public function getSmtpOptions($storeId)
    {
        return new SmtpOptions(
            [
                'host' => $this->getSmtpHost($storeId),
                'port' => $this->getSmtpPort($storeId),
                'connection_class' => 'login',
                'connection_config' =>
                [
                    'username' => $this->getSmtpUsername($storeId),
                    'password' => $this->getSmtpPassword($storeId),
                    'ssl' => 'tls'
                ]
            ]
        );
    }
487031
private function getIPWhitelistConfig($storeId = null)
    {
        return $this->getScopeConfig()->getValue(
            self::XML_PATH_IP_WHITELIST,
            ScopeInterface::SCOPE_STORE,
            $storeId
        );
    }
838665
public function retrieveConnectedTerminals($storeId)
    {
        $requestUrl = self::ENDPOINT_CONNECTED_TERMINALS_LIVE;
        if ($this->_helper()->getConfigDataDemoMode($storeId)) {
            $requestUrl = self::ENDPOINT_CONNECTED_TERMINALS_TEST;
        }

        $apiKey = $this->_helper()->getPosApiKey($storeId);
        $merchantAccount = $this->_helper()->getAdyenMerchantAccount("pos_cloud", $storeId);
        $request = array("merchantAccount" => $merchantAccount);

        //If store_code is configured, retrieve only terminals connected to that store
        $storeCode = $this->_helper()->getConfigData('store_code', 'adyen_pos_cloud', $storeId);
        if ($storeCode) {
            $request["store"] = $storeCode;
        }
        $response = $this->doRequestJson($request, $requestUrl, $apiKey, $storeId);
        return $response;
    }
763483
public function loadPriceData($storeId, $productIds)
    {
        $websiteId = $this->getStore($storeId)->getWebsiteId();

        $baseSelects = [];
        foreach ($this->getPriceIndexDimensionsTables($websiteId) as $dimensionsTable) {
            $baseSelects[] = $this->getLoadPriceDataSelect($dimensionsTable, $websiteId, $productIds);
        }
        $select = $this->getConnection()->select()->union($baseSelects);

        return $this->getConnection()->fetchAll($select);
    }
540078
public function doRequestSync(array $request, $storeId)
    {
        $requestUrl = self::ENDPOINT_TERMINAL_CLOUD_LIVE;
        if ($this->_helper()->getConfigDataDemoMode($storeId)) {
            $requestUrl = self::ENDPOINT_TERMINAL_CLOUD_TEST;
        }

        $apiKey = $this->_helper()->getPosApiKey($storeId);
        $timeout = $this->_helper()->getConfigData('timeout', 'adyen_pos_cloud', $storeId);
        $response = $this->doRequestJson($request, $requestUrl, $apiKey, $storeId, $timeout);
        return json_decode($response, true);
    }
1296809
public function isStoreEnabled($storeId)
    {
        return $this->scopeConfig->isSetFlag(
            \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_API_ENABLED,
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
            $storeId
        );
    }
795698
public function addData($storeId, array $indexData)
    {
        $inventoryData = $this->getResourceModel()->loadInventoryData($storeId, array_keys($indexData));

        foreach ($inventoryData as $inventoryDataRow) {
            $productId = (int) $inventoryDataRow['product_id'];
            $indexData[$productId]['stock'] = [
                'is_in_stock' => (bool) $inventoryDataRow['stock_status'],
                'qty'         => (int) $inventoryDataRow['qty'],
            ];
        }

        return $indexData;
    }
1214945
public function rebuildStoreIndex($storeId, $productIds = null)
    {
        $productId = 0;

        // Magento is only sending children ids here. Ensure to reindex also the parents product ids, if any.
        if (!empty($productIds)) {
            $productIds = array_unique(array_merge($productIds, $this->resourceModel->getRelationsByChild($productIds)));
        }

        do {
            $products = $this->getSearchableProducts($storeId, $productIds, $productId);

            foreach ($products as $productData) {
                $productId = (int) $productData['entity_id'];
                $productData['has_options']      = (bool) $productData['has_options'];
                $productData['required_options'] = (bool) $productData['required_options'];
                yield $productId => $productData;
            }
        } while (!empty($products));
    }