Retrieve session data to be indexed.

@param int      $storeId    Store id.
@param string[] $sessionIds Session ids.

@return array
779001
public function getSessionData($storeId, $sessionIds)
    {
        $data = [];
        $searchRequest  = $this->getSearchRequest($storeId, $sessionIds);
        $searchResponse = $this->searchEngine->search($searchRequest);

        foreach ($searchResponse->getAggregations()->getBucket('session_id')->getValues() as $sessionValue) {
            $sessionData = $this->processSessionData($sessionValue);
            $sessionData['store_id'] = $storeId;
            unset($sessionData['count']);

            $data[] = array_filter($sessionData);
        }

        return $data;
    }
570440
public function read($sessionId): string
    {
        $encryptedData = parent::read($sessionId);

        return $this->decrypt($encryptedData);
    }
1173458
public function getStoreQuotesFromQuoteIds($quoteIds, $storeId)
    {
        $salesCollection = $this->quoteCollection->create()
            ->addFieldToFilter('is_active', 1)
            ->addFieldToFilter('items_count', ['gt' => 0])
            ->addFieldToFilter('customer_email', ['neq' => ''])
            ->addFieldToFilter('entity_id', ['in' => $quoteIds]);

        if ($this->helper->isOnlySubscribersForAC($storeId)) {
            $salesCollection = $this->subscriberFilterer->filterBySubscribedStatus($salesCollection);
        }

        return $salesCollection;
    }
390915
public function read($session_id)
	{
		// get session hash
		$session = $this->database->hgetall($this->key($session_id));

		// return session data
		return (isset($session['data'])) ? $session['data'] : null;
	}
275350
public function getRedirectEntityList($siteId)
    {
        try {
            $result = $this->getRedirectQuery($siteId)->getResult();
        } catch (NoResultException $e) {
            $result = [];
        }

        return $result;
    }
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);
    }
780233
function get_session_by_id($sessionid) {
        try {
            $param = new \Panopto\SessionManagement\GetSessionsById($this->auth, array($sessionid));
            $sessions = $this->smclient->GetSessionsById($param)->getGetSessionsByIdResult()->getSession();
        } catch (Exception $e) {
            return false;
        }
        if (count($sessions)) {
            return $sessions[0];
        }
        return false;
    }
1371873
public function initSessionData(string $sessionId): void
    {
        $data = [
            'uid' => 0,
            'session_data' => [],
            'expired_at' => time() + $this->sessionLife,
            'updated_at' => time()
        ];
        $this->isNew = true;
        $this->destroyed = false;
        $this->commited = false;
        if (($sessionId != '') && $this->checkSessionExists($sessionId)) {
            $this->isNew = false;
            $data = $this->loadSessionData($sessionId);
        } else {
            do {
                $sessionId = $this->makeSessionId();
            } while ($this->checkSessionExists($sessionId));
        }
        $attributes = [
            'uid' => $data['uid'],
            'expired_at' => $data['expired_at'],
            'updated_at' => $data['updated_at'],
            'session_id' => $sessionId
        ];
        $sessionData = $data['session_data'];
        $this->sessionAttributes = new ObserverData($attributes);
        $this->sessionData = new ObserverData($sessionData);
    }
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;
    }
1285306
public function session_read($sessionId)
    {
        // assign the current session id
        $this->sessionId   = (string)$sessionId;
        $this->sessionData = $this->engine->get($this->sessionKey . $sessionId);
        // if the sessionData is "false" set it to be an array (casting would create an array with a false entry)
        if (!$this->sessionData) {
            $this->sessionData = [];
        }

        // session data is set uncompressed
        return $this->sessionData;
    }
532484
private function getSmtpUsername($storeId = null)
    {
        return $this->scopeConfig->getValue(
            self::XML_PATH_DDG_TRANSACTIONAL_USERNAME,
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
            $storeId
        );
    }
734287
public static function fetchByClientId( $clientId )
    {
        $session = ezcPersistentSessionInstance::get();

        $q = $session->createFindQuery( __CLASS__ );
        $q->where( $q->expr->eq( 'client_id', $q->bindValue( $clientId ) ) );
        $results = $session->find( $q, __CLASS__ );
        if ( count( $results ) != 1 )
            return false;
        else
            return array_shift( $results );
    }
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
        );
    }
937827
public static function get_steps($tourid) {
        $steps = cache::get_stepdata($tourid);

        $return = [];
        foreach ($steps as $step) {
            $return[$step->id] = step::load_from_record($step);
        }
        return $return;
    }
1306564
private function getPageFilter($filterName, $storeId = null)
    {
        $pageFilters = $this->getPageFilters($storeId);
        if ($pageFilters && @$pageFilters->$filterName) {
            return (array)$pageFilters->$filterName;
        }
        return [];
    }
875555
public function addData($storeId, array $indexData)
    {
        $priceData = $this->resourceModel->loadPriceData($storeId, array_keys($indexData));

        foreach ($priceData as $priceDataRow) {
            $productId     = (int) $priceDataRow['entity_id'];
            $productTypeId = $indexData[$productId]['type_id'];
            $priceModifier = $this->getPriceDataReader($productTypeId);

            $originalPrice = $priceModifier->getOriginalPrice($priceDataRow);
            $price         = $priceModifier->getPrice($priceDataRow);

            $indexData[$productId]['price'][] = [
                'price'             => $price,
                'original_price'    => $originalPrice,
                'is_discount'       => $price < $originalPrice,
                'customer_group_id' => $priceDataRow['customer_group_id'],
            ];

            if (!isset($indexData[$productId]['indexed_attributes'])) {
                $indexData[$productId]['indexed_attributes'] = ['price'];
            } elseif (!in_array('price', $indexData[$productId]['indexed_attributes'])) {
                // Add price only one time.
                $indexData[$productId]['indexed_attributes'][] = 'price';
            }
        }

        return $indexData;
    }
1300863
public function getExpiredEmailCampaignsByStoreIds($storeIds)
    {
        $time = new \DateTime('now', new \DateTimezone('UTC'));
        $interval = $this->dateIntervalFactory->create(
            ['interval_spec' => sprintf('PT%sH', 2)]
        );
        $time->sub($interval);

        $campaignCollection = $this->addFieldToFilter('campaign_id', ['notnull' => true])
            ->addFieldToFilter('send_status', \Dotdigitalgroup\Email\Model\Campaign::PROCESSING)
            ->addFieldToFilter('store_id', ['in' => $storeIds])
            ->addFieldToFilter('send_id', ['notnull' => true])
            ->addFieldToFilter('updated_at', ['lt' => $time->format('Y-m-d H:i:s')]);

        return $campaignCollection;
    }