Loads the main store.

@return int
Loaded store ID or NULL if one couldn't be found.
171221
protected function loadStoreId() {
    $query = Drupal::entityQuery('commerce_store');
    $result = $query->execute();

    // There should only ever be one value returned so we naively use the first
    // item in the array. This should generally be safe as this should only run
    // within a Drupal site install context.
    $storeId = NULL;
    if (count($result) > 0) {
      $storeId = reset($result);
    }

    return $storeId;
  }
639298
public static function load()
    {
        $session = Config::get('session');

        static::start($session['storage']);

        static::$instance->load(Cookie::get($session['cookie']));
    }
615265
private function loadLocation(): ?Location
    {
        if (!$this->context->has('ez_location_id')) {
            return null;
        }

        return $this->locationService->loadLocation(
            (int) $this->context->get('ez_location_id')
        );
    }
557279
public function getStoreId()
    {
        if (!$this->_storeId){
            $this->_storeId = $this->_storeManager->getStore()->getId();
        }
        return $this->_storeId;
    }
38907
function LoadCurrent()
    {
        $this->user = null;
        $userID = null;
        if (isset($_SESSION[self::$sessionParam]))
             $userID = $_SESSION[self::$sessionParam];
        
        if ($userID)
        {
            $user = new User($userID);
            if ($user->Exists())
                $this->user = $user;
        }
        return $this->user !== null;
    }
84102
protected function loadFromStore()
    {
        if (false === $this->isLoaded()) {
            // Loads collection from the database on iteration.
            $models = $this->store->loadCollection($this);
            $this->setModels($models);
            $this->loaded = true;
        }
    }
147367
private function load()
    {
        $this->initialise();
        $this->data_connector->resourceLinkShareKeyLoad($this);
        if (!is_null($this->id)) {
            $this->length = strlen($this->id);
        }
        if (!is_null($this->expires)) {
            $this->life = ($this->expires - time()) / 60 / 60;
        }
    }
34709
protected function load()
    {
        if ($this->resources !== null) {
            return $this->count() > 0;
        }

        $this->resources = null;
        $this->index = 0;
        $this->loadResources();

        return $this->count() > 0;
    }
1174114
private function load()
    {
        if (null === $this->collection) {
            $this->collection = $this->transformer->getChildren($this->page);
        }
    }
447537
public function targetStore() {
		if ($this->owner->ParentID) {
			$store = $this->owner->Parent()->getCDNStore();
			return $store;
		}

		return $this->contentService->getDefaultStore();
	}
1096646
private function load()
    {
        if (!file_exists($this->file)) {
            $this->createEmptyStore();
        }

        $fh = fopen($this->file, 'r+');

        if (flock($fh, LOCK_SH)) {
            $rawContent = fread($fh, filesize($this->file));
            fflush($fh);
            flock($fh, LOCK_UN);
            fclose($fh);
        } else {
            throw new \Exception('Could not acquire shared file lock.');
        }

        $this->content = json_decode(gzdecode($rawContent));

        if ($this->content === null) {
            throw new Exception('Invalid store content');
        }
    }
1126365
public function loadCurrent()
    {
        $sViewName = $this->getBaseObject()->getViewName();
        $sDate = date('Y-m-d H:i:s', \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime());
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        $sQ = "select * from {$sViewName} where oxtype=2 and oxactive=1 and oxshopid='" . \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId() . "' and (oxactiveto > " . $oDb->quote($sDate) . " or oxactiveto=0) and oxactivefrom != 0 and oxactivefrom < " . $oDb->quote($sDate) . "
               " . $this->_getUserGroupFilter() . "
               order by oxactiveto, oxactivefrom";
        $this->selectString($sQ);
    }
231117
public function startup()
    {
        /** @var \Shopgate\Base\Helper\Initializer\Config $initializer */
        $manager              = ObjectManager::getInstance();
        $initializer          = $manager->get('Shopgate\Base\Helper\Initializer\Config');
        $this->storeManager   = $initializer->getStoreManager();
        $this->logger         = $initializer->getLogger();
        $this->directory      = $initializer->getDirectory();
        $this->sgCoreConfig   = $initializer->getSgCoreConfig();
        $this->coreConfig     = $initializer->getCoreConfig();
        $this->cache          = $initializer->getCache();
        $this->configResource = $initializer->getConfigResource();
        $this->configMapping  = $initializer->getConfigMapping();
        $this->configMethods  = $initializer->getConfigMethods();
        $this->registry       = $initializer->getRegistry();
        $this->configHelper   = $initializer->getHelper();
        $this->plugin_name    = 'magento2';
        $this->configMapping  += $this->configHelper->loadUndefinedConfigPaths();
        $this->loadArray($this->configMethods);

        return true;
    }
78108
protected function loadCartFromSession()
    {
        $cartIdInSession = $this
            ->cartSessionManager
            ->get();

        if (!$cartIdInSession) {
            return null;
        }

        $cart = $this
            ->cartRepository
            ->findOneBy([
                'id' => $cartIdInSession,
                'ordered' => false,
            ]);

        return ($cart instanceof CartInterface)
            ? $cart
            : null;
    }
700546
private function loadCategory()
    {
        $category   = $this->categoryFactory->create();
        $storeId    = $this->getRequest()->getParam('store');
        $categoryId = $this->getRequest()->getParam('entity_id');

        $category->setStoreId($storeId)->load($categoryId);

        return $category;
    }
314538
private function load($id = null)
    {

        $this->initialize();
        $this->id = $id;
        $dataConnector = $this->getDataConnector();
        if (!is_null($dataConnector)) {
            return $dataConnector->loadUser($this);
        }

        return false;
    }
741001
private function getDefaultStoreId()
    {
        $store = $this->storeManager->getDefaultStoreView();

        if (null === $store) {
            // Occurs when current user does not have access to default website (due to AdminGWS ACLS on Magento EE).
            $store = !empty($this->storeManager->getWebsites()) ? current($this->storeManager->getWebsites())->getDefaultStore() : null;
        }

        return $store ? $store->getId() : 0;
    }