StoreManager
Magento\Store\Model\StoreManager
What it does
StoreManager is the central service for managing and retrieving store, website, and store group information in Magento 2.
Developers use this class to get the current store context, check if the system is in single-store mode, switch between stores, or retrieve lists of stores, websites, and groups.
It's essential for any functionality that needs to be aware of multi-store configurations or operate within a specific store scope.
Public Methods
- setCurrentStore()
- setIsSingleStoreModeAllowed()
- hasSingleStore()
- isSingleStoreMode()
- getStore()
- getStores()
- getWebsite()
- getWebsites()
- reinitStores()
- getDefaultStoreView()
- getGroup()
- getGroups()
- getStoreByWebsiteId()
- _resetState()