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