Helper/Data.php
public function getWebsiteForSelectedScopeInAdmin()
    {
        /**
         * See first if store param exist. If it does than get website from store.
         * If website param does not exist then default value returned 0 "default scope"
         * This is because there is no website param in default scope
         */
        $storeId = $this->_request->getParam('store');
        $websiteId = ($storeId) ? $this->storeManager->getStore($storeId)->getWebsiteId() :
            $this->_request->getParam('website', 0);
        return $this->storeManager->getWebsite($websiteId);
    }
public function getWebsiteForSelectedScopeInAdmin()
    {
        /**
         * See first if store param exist. If it does than get website from store.
         * If website param does not exist then default value returned 0 "default scope"
         * This is because there is no website param in default scope
         */
        $storeId = $this->_request->getParam('store');
        $websiteId = ($storeId) ? $this->storeManager->getStore($storeId)->getWebsiteId() :
            $this->_request->getParam('website', 0);
        return $this->storeManager->getWebsite($websiteId);
    }
public function getWebsiteForSelectedScopeInAdmin ( ) { /**
         * See first if store param exist. If it does than get website from store.
         * If website param does not exist then default value returned 0 "default scope"
         * This is because there is no website param in default scope
         */ $ storeId = $ this -> _request -> getParam ( 'store' ) ; $ websiteId = ( $ storeId ) ? $ this -> storeManager -> getStore ( $ storeId ) -> getWebsiteId ( ) : $ this -> _request -> getParam ( 'website' , 0 ) ; return $ this -> storeManager -> getWebsite ( $ websiteId ) ; }
Get website for selected scope in admin

@return \Magento\Store\Api\Data\WebsiteInterface
Get website for selected scope in admin