_storeManager = $storeManager; } /** * {@inheritdoc} * @throws \Magento\Framework\Exception\State\InitException */ public function getScope($scopeId = null) { $scope = $this->_storeManager->getWebsite($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 websites * * @return \Magento\Store\Model\Website[] */ public function getScopes() { return $this->_storeManager->getWebsites(); } }