_storeManager = $storeManager; } /** * {@inheritdoc} * @throws \Magento\Framework\Exception\State\InitException */ public function getScope($scopeId = null) { $scope = $this->_storeManager->getStore($scopeId); if (!$scope instanceof \Magento\Framework\App\ScopeInterface) { throw new \Magento\Framework\Exception\State\InitException( __('The scope object is invalid. Verify the scope object and try again.') ); } return $scope; } /** * Retrieve a list of available stores * * @return \Magento\Store\Model\Store[] */ public function getScopes() { return $this->_storeManager->getStores(); } }