Log in
Model

StoreManager

Magento\Store\Model\StoreManager

What it does

StoreManager is the primary service for managing and retrieving store, website, and store group information in Magento 2.

Developers use this class to get the current store, check if the system is in single-store mode, retrieve all stores/websites/groups, and switch between stores.

It's essential for any multi-store operations, store-specific configurations, or when you need to access store hierarchy data.

Public Methods

  • setCurrentStore()
  • setIsSingleStoreModeAllowed()
  • hasSingleStore()
  • isSingleStoreMode()
  • getStore()
  • getStores()
  • getWebsite()
  • getWebsites()
  • reinitStores()
  • getDefaultStoreView()
  • getGroup()
  • getGroups()
  • getStoreByWebsiteId()
  • _resetState()