Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Scope.php
Go to the documentation of this file.
1 <?php
7 
9 {
15  protected $_defaultScope;
16 
22  protected $_currentScope;
23 
29  protected $_areaList;
30 
37  public function __construct(\Magento\Framework\App\AreaList $areaList, $defaultScope = 'primary')
38  {
39  $this->_defaultScope = $this->_currentScope = $defaultScope;
40  $this->_areaList = $areaList;
41  }
42 
48  public function getCurrentScope()
49  {
50  return $this->_currentScope;
51  }
52 
59  public function setCurrentScope($scope)
60  {
61  $this->_currentScope = $scope;
62  }
63 
69  public function getAllScopes()
70  {
71  $codes = $this->_areaList->getCodes();
72  array_unshift($codes, $this->_defaultScope);
73  return $codes;
74  }
75 }
__construct(\Magento\Framework\App\AreaList $areaList, $defaultScope='primary')
Definition: Scope.php:37