public function getStoreFromContext()
    {
        $params = $this->getRequest()->getParams();

        if (isset($params['store'])) {
            return [$params['store']];
        } elseif (isset($params['website'])) {
            /** @var Website $website */
            $website = $this->storeManager->getWebsite($params['website']);

            return $website->getStoreIds();
        }

        return array_keys($this->storeManager->getStores());
    }
public function getStoreFromContext()
    {
        $params = $this->getRequest()->getParams();

        if (isset($params['store'])) {
            return [$params['store']];
        } elseif (isset($params['website'])) {
            /** @var Website $website */
            $website = $this->storeManager->getWebsite($params['website']);

            return $website->getStoreIds();
        }

        return array_keys($this->storeManager->getStores());
    }
public function getStoreFromContext ( ) { $ params = $ this -> getRequest ( ) -> getParams ( ) ; if ( isset ( $ params [ 'store' ] ) ) { return [ $ params [ 'store' ] ] ; } elseif ( isset ( $ params [ 'website' ] ) ) { /** @var Website $website */ $ website = $ this -> storeManager -> getWebsite ( $ params [ 'website' ] ) ; return $ website -> getStoreIds ( ) ; } return array_keys ( $ this -> storeManager -> getStores ( ) ) ; }
Retrieves the stores that are allowed in the context
E.g. Store X will just return itself
E.g. Website Y will return an array of all stores under it
E.g. Default will return all store ids

@return array - e.g. [1] or [1,3]
@throws \Magento\Framework\Exception\LocalizedException
Retrieves the stores that are allowed in the context E . g . Store X will just return itself E . g . Website Y will return an array of all stores under it E . g . Default will return all store ids