Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
__construct (\Magento\Store\Api\StoreRepositoryInterface $storeRepository, \Magento\Store\Api\GroupRepositoryInterface $groupRepository, \Magento\Store\Api\WebsiteRepositoryInterface $websiteRepository, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, StoreResolverInterface $storeResolver, \Magento\Framework\Cache\FrontendInterface $cache, $isSingleStoreAllowed=true) | |
setCurrentStore ($store) | |
setIsSingleStoreModeAllowed ($value) | |
hasSingleStore () | |
isSingleStoreMode () | |
getStore ($storeId=null) | |
getStores ($withDefault=false, $codeKey=false) | |
getWebsite ($websiteId=null) | |
getWebsites ($withDefault=false, $codeKey=false) | |
reinitStores () | |
getDefaultStoreView () | |
getGroup ($groupId=null) | |
getGroups ($withDefault=false) | |
getStoreByWebsiteId ($websiteId) | |
Data Fields | |
const | PARAM_RUN_CODE = 'MAGE_RUN_CODE' |
const | PARAM_RUN_TYPE = 'MAGE_RUN_TYPE' |
const | XML_PATH_SINGLE_STORE_MODE_ENABLED = 'general/single_store_mode/enabled' |
![]() | |
const | CONTEXT_STORE = 'store' |
const | PARAM_NAME = '___store' |
Protected Member Functions | |
isSingleStoreModeEnabled () | |
Protected Attributes | |
$storeRepository | |
$groupRepository | |
$websiteRepository | |
$scopeConfig | |
$storeResolver | |
$cache | |
$currentStoreId = null | |
$_hasSingleStore | |
$isSingleStoreAllowed | |
Service contract, which manage scopes
@SuppressWarnings(PHPMD.CouplingBetweenObjects)
Definition at line 17 of file StoreManager.php.
__construct | ( | \Magento\Store\Api\StoreRepositoryInterface | $storeRepository, |
\Magento\Store\Api\GroupRepositoryInterface | $groupRepository, | ||
\Magento\Store\Api\WebsiteRepositoryInterface | $websiteRepository, | ||
\Magento\Framework\App\Config\ScopeConfigInterface | $scopeConfig, | ||
StoreResolverInterface | $storeResolver, | ||
\Magento\Framework\Cache\FrontendInterface | $cache, | ||
$isSingleStoreAllowed = true |
|||
) |
\Magento\Store\Api\StoreRepositoryInterface | $storeRepository | |
\Magento\Store\Api\GroupRepositoryInterface | $groupRepository | |
\Magento\Store\Api\WebsiteRepositoryInterface | $websiteRepository | |
\Magento\Framework\App\Config\ScopeConfigInterface | $scopeConfig | |
StoreResolverInterface | $storeResolver | |
\Magento\Framework\Cache\FrontendInterface | $cache | |
bool | $isSingleStoreAllowed |
Definition at line 98 of file StoreManager.php.
getDefaultStoreView | ( | ) |
{Retrieve default store for default group and website
Implements StoreManagerInterface.
Definition at line 247 of file StoreManager.php.
getGroup | ( | $groupId = null | ) |
{Retrieve application store group object
null | \Magento\Store\Api\Data\GroupInterface | string | $groupId |
Implements StoreManagerInterface.
Definition at line 257 of file StoreManager.php.
getGroups | ( | $withDefault = false | ) |
{Prepare array of store groups
bool | $withDefault |
Implements StoreManagerInterface.
Definition at line 272 of file StoreManager.php.
getStore | ( | $storeId = null | ) |
{Retrieve application store object
null | string | bool | int | \Magento\Store\Api\Data\StoreInterface | $storeId |
NoSuchEntityException | If given store doesn't exist. |
Implements StoreManagerInterface.
Definition at line 152 of file StoreManager.php.
getStoreByWebsiteId | ( | $websiteId | ) |
Get assigned to website store
int | $websiteId |
Implements StoreWebsiteRelationInterface.
Definition at line 312 of file StoreManager.php.
{Retrieve stores array
bool | $withDefault | |
bool | $codeKey |
Implements StoreManagerInterface.
Definition at line 176 of file StoreManager.php.
getWebsite | ( | $websiteId = null | ) |
{Retrieve application website object
null | bool | int | string | \Magento\Store\Api\Data\WebsiteInterface | $websiteId |
Implements StoreManagerInterface.
Definition at line 195 of file StoreManager.php.
{Get loaded websites
bool | $withDefault | |
bool | $codeKey |
Implements StoreManagerInterface.
Definition at line 215 of file StoreManager.php.
hasSingleStore | ( | ) |
{Check if store has only one store view
Implements StoreManagerInterface.
Definition at line 135 of file StoreManager.php.
isSingleStoreMode | ( | ) |
{Check if system is run in the single store mode
Implements StoreManagerInterface.
Definition at line 144 of file StoreManager.php.
|
protected |
Check if Single-Store mode is enabled in configuration
This flag only shows that admin does not want to show certain UI components at backend (like store switchers etc) if Magento has only one store view but it does not check the store view collection
Definition at line 292 of file StoreManager.php.
reinitStores | ( | ) |
{Reinitialize store list
Implements StoreManagerInterface.
Definition at line 234 of file StoreManager.php.
setCurrentStore | ( | $store | ) |
{Set current default store
string | $store |
Implements StoreManagerInterface.
Definition at line 119 of file StoreManager.php.
setIsSingleStoreModeAllowed | ( | $value | ) |
{Allow or disallow single store mode
bool | $value |
Implements StoreManagerInterface.
Definition at line 127 of file StoreManager.php.
|
protected |
Definition at line 80 of file StoreManager.php.
|
protected |
Definition at line 66 of file StoreManager.php.
|
protected |
Definition at line 73 of file StoreManager.php.
|
protected |
Definition at line 44 of file StoreManager.php.
|
protected |
Definition at line 87 of file StoreManager.php.
|
protected |
Definition at line 56 of file StoreManager.php.
|
protected |
Definition at line 39 of file StoreManager.php.
|
protected |
Definition at line 61 of file StoreManager.php.
|
protected |
Definition at line 49 of file StoreManager.php.
const PARAM_RUN_CODE = 'MAGE_RUN_CODE' |
Application run code
Definition at line 24 of file StoreManager.php.
const PARAM_RUN_TYPE = 'MAGE_RUN_TYPE' |
Application run type (store|website)
Definition at line 29 of file StoreManager.php.
const XML_PATH_SINGLE_STORE_MODE_ENABLED = 'general/single_store_mode/enabled' |
Whether single store mode enabled or not
Definition at line 34 of file StoreManager.php.