Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ScopeResolver.php
Go to the documentation of this file.
1 <?php
6 namespace Magento\Framework\App;
7 
9 
11 {
15  protected $objectManager;
16 
20  private $defaultScope;
21 
28  {
29  $this->objectManager = $objectManager;
30  }
31 
36  public function getScope($scopeId = null)
37  {
38  if (!$this->defaultScope) {
39  $this->defaultScope = $this->objectManager->create(ScopeDefault::class);
40  }
41 
42  return $this->defaultScope;
43  }
44 
50  public function getScopes()
51  {
52  return [$this->defaultScope];
53  }
54 }
__construct(ObjectManagerInterface $objectManager)