Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-store
Model
ScopeTreeProvider.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Store\Model
;
7
8
use
Magento\Framework\App\Config\ScopeConfigInterface
;
9
use
Magento\Framework\App\ScopeTreeProviderInterface
;
10
use
Magento\Store\Model\Group
;
11
use
Magento\Store\Model\Store
;
12
use
Magento\Store\Model\Website
;
13
14
class
ScopeTreeProvider
implements
ScopeTreeProviderInterface
15
{
19
protected
$storeManager
;
20
24
public
function
__construct
(
25
StoreManagerInterface
$storeManager
26
) {
27
$this->storeManager =
$storeManager
;
28
}
29
33
public
function
get
()
34
{
35
$defaultScope = [
36
'scope'
=>
ScopeConfigInterface::SCOPE_TYPE_DEFAULT
,
37
'scope_id'
=>
null
,
38
'scopes'
=> [],
39
];
40
42
foreach
($this->storeManager->getWebsites() as
$website
) {
43
$websiteScope = [
44
'scope'
=>
ScopeInterface::SCOPE_WEBSITES
,
45
'scope_id'
=>
$website
->getId(),
46
'scopes'
=> [],
47
];
48
50
foreach
(
$website
->getGroups() as
$group
) {
51
$groupScope = [
52
'scope'
=>
ScopeInterface::SCOPE_GROUP
,
53
'scope_id'
=>
$group
->getId(),
54
'scopes'
=> [],
55
];
56
58
foreach
(
$group
->getStores() as
$store
) {
59
$storeScope = [
60
'scope'
=>
ScopeInterface::SCOPE_STORES
,
61
'scope_id'
=>
$store
->getId(),
62
'scopes'
=> [],
63
];
64
$groupScope[
'scopes'
][] = $storeScope;
65
}
66
$websiteScope[
'scopes'
][] = $groupScope;
67
}
68
$defaultScope[
'scopes'
][] = $websiteScope;
69
}
70
return
$defaultScope;
71
}
72
}
$website
$website
Definition:
payment_configuration_rollback.php:38
Magento\Framework\App\Config\ScopeConfigInterface\SCOPE_TYPE_DEFAULT
const SCOPE_TYPE_DEFAULT
Definition:
ScopeConfigInterface.php:20
$group
$group
Definition:
sections.phtml:16
Magento\Store\Model\ScopeInterface\SCOPE_WEBSITES
const SCOPE_WEBSITES
Definition:
ScopeInterface.php:19
Magento\Store\Model\Website
Definition:
Website.php:26
Magento\Store\Model\ScopeTreeProvider\$storeManager
$storeManager
Definition:
ScopeTreeProvider.php:19
Magento\Store\Model
Magento\Store\Model\StoreManagerInterface
Definition:
StoreManagerInterface.php:17
Magento\Store\Model\ScopeInterface\SCOPE_STORES
const SCOPE_STORES
Definition:
ScopeInterface.php:17
Magento\Framework\App\ScopeTreeProviderInterface
Definition:
ScopeTreeProviderInterface.php:12
Magento\Store\Model\ScopeInterface\SCOPE_GROUP
const SCOPE_GROUP
Definition:
ScopeInterface.php:22
Magento\Store\Model\ScopeTreeProvider\__construct
__construct(StoreManagerInterface $storeManager)
Definition:
ScopeTreeProvider.php:24
Magento\Store\Model\Group
Definition:
Group.php:19
Magento\Store\Model\ScopeTreeProvider
Definition:
ScopeTreeProvider.php:14
$store
$store
Definition:
payment_configuration_rollback.php:33
Magento\Store\Model\Store
Definition:
Store.php:38
Magento\Framework\App\Config\ScopeConfigInterface
Definition:
ScopeConfigInterface.php:15