Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Group.php
Go to the documentation of this file.
1 <?php
8 
13 
14 class Group implements ScopeResolverInterface
15 {
19  protected $storeManager;
20 
25  {
26  $this->storeManager = $storeManager;
27  }
28 
33  public function getScope($scopeId = null)
34  {
35  $scope = $this->storeManager->getGroup($scopeId);
36  if (!$scope instanceof ScopeInterface) {
37  throw new InitException(__('The scope object is invalid. Verify the scope object and try again.'));
38  }
39 
40  return $scope;
41  }
42 
48  public function getScopes()
49  {
50  return $this->storeManager->getGroups();
51  }
52 }
__()
Definition: __.php:13
__construct(StoreManagerInterface $storeManager)
Definition: Group.php:24