Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Store.php
Go to the documentation of this file.
1 <?php
8 
10 {
14  protected $_storeManager;
15 
20  {
21  $this->_storeManager = $storeManager;
22  }
23 
28  public function getScope($scopeId = null)
29  {
30  $scope = $this->_storeManager->getStore($scopeId);
31  if (!$scope instanceof \Magento\Framework\App\ScopeInterface) {
32  throw new \Magento\Framework\Exception\State\InitException(
33  __('The scope object is invalid. Verify the scope object and try again.')
34  );
35  }
36 
37  return $scope;
38  }
39 
45  public function getScopes()
46  {
47  return $this->_storeManager->getStores();
48  }
49 }
__construct(\Magento\Store\Model\StoreManagerInterface $storeManager)
Definition: Store.php:19
$storeManager
__()
Definition: __.php:13