Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields
StoreManagerInterface Interface Reference
Inheritance diagram for StoreManagerInterface:
StoreManager StoreManager

Public Member Functions

 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)
 
 setCurrentStore ($store)
 

Data Fields

const CONTEXT_STORE = 'store'
 
const PARAM_NAME = '___store'
 

Detailed Description

Store manager interface

@api

Since
100.0.2

Definition at line 17 of file StoreManagerInterface.php.

Member Function Documentation

◆ getDefaultStoreView()

getDefaultStoreView ( )

Retrieve default store for default group and website

Returns
\Magento\Store\Api\Data\StoreInterface|null

Implemented in StoreManager, and StoreManager.

◆ getGroup()

getGroup (   $groupId = null)

Retrieve application store group object

Parameters
null | \Magento\Store\Api\Data\GroupInterface | string$groupId
Returns
\Magento\Store\Api\Data\GroupInterface

Implemented in StoreManager, and StoreManager.

◆ getGroups()

getGroups (   $withDefault = false)

Prepare array of store groups

Parameters
bool$withDefault
Returns
\Magento\Store\Api\Data\GroupInterface[]

Implemented in StoreManager, and StoreManager.

◆ getStore()

getStore (   $storeId = null)

Retrieve application store object

Parameters
null | string | bool | int | \Magento\Store\Api\Data\StoreInterface$storeId
Returns
\Magento\Store\Api\Data\StoreInterface
Exceptions
NoSuchEntityExceptionIf given store doesn't exist.

Implemented in StoreManager, and StoreManager.

◆ getStores()

getStores (   $withDefault = false,
  $codeKey = false 
)

Retrieve stores array

Parameters
bool$withDefault
bool$codeKey
Returns
\Magento\Store\Api\Data\StoreInterface[]

Implemented in StoreManager, and StoreManager.

◆ getWebsite()

getWebsite (   $websiteId = null)

Retrieve application website object

Parameters
null | bool | int | string | \Magento\Store\Api\Data\WebsiteInterface$websiteId
Returns
\Magento\Store\Api\Data\WebsiteInterface
Exceptions

Implemented in StoreManager, and StoreManager.

◆ getWebsites()

getWebsites (   $withDefault = false,
  $codeKey = false 
)

Get loaded websites

Parameters
bool$withDefault
bool$codeKey
Returns
\Magento\Store\Api\Data\WebsiteInterface[]

Implemented in StoreManager, and StoreManager.

◆ hasSingleStore()

hasSingleStore ( )

Check if store has only one store view

Returns
bool

Implemented in StoreManager, and StoreManager.

◆ isSingleStoreMode()

isSingleStoreMode ( )

Check if system is run in the single store mode

Returns
bool

Implemented in StoreManager, and StoreManager.

◆ reinitStores()

reinitStores ( )

Reinitialize store list

Returns
void

Implemented in StoreManager, and StoreManager.

◆ setCurrentStore()

setCurrentStore (   $store)

Set current default store

Parameters
string$store
Returns
void

Implemented in StoreManager, and StoreManager.

◆ setIsSingleStoreModeAllowed()

setIsSingleStoreModeAllowed (   $value)

Allow or disallow single store mode

Parameters
bool$value
Returns
void

Implemented in StoreManager, and StoreManager.

Field Documentation

◆ CONTEXT_STORE

const CONTEXT_STORE = 'store'

Store cache context

Definition at line 22 of file StoreManagerInterface.php.

◆ PARAM_NAME

const PARAM_NAME = '___store'

The store GET Param name

Definition at line 27 of file StoreManagerInterface.php.


The documentation for this interface was generated from the following file: