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
framework
App
Scope
Source.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\App\Scope
;
7
8
use
Magento\Framework\App\ScopeResolverPool
;
9
use
Magento\Framework\Option\ArrayInterface
;
10
11
class
Source
implements
ArrayInterface
12
{
16
protected
$scopeResolverPool
;
17
21
protected
$scope
;
22
27
public
function
__construct
(
28
ScopeResolverPool
$scopeResolverPool
,
29
$scope
30
) {
31
$this->scopeResolverPool =
$scopeResolverPool
;
32
$this->scope =
$scope
;
33
}
34
40
public
function
toOptionArray
()
41
{
42
$scopes = $this->scopeResolverPool->get($this->scope)->getScopes();
43
$array = [];
44
foreach
($scopes as
$scope
) {
45
$array[] = [
'value'
=>
$scope
->getId(),
'label'
=>
$scope
->getName()];
46
}
47
return
$array;
48
}
49
}
Magento\Framework\App\Scope\Source\__construct
__construct(ScopeResolverPool $scopeResolverPool, $scope)
Definition:
Source.php:27
Magento\Framework\App\Scope\Source\$scopeResolverPool
$scopeResolverPool
Definition:
Source.php:16
Magento\Framework\App\Scope\Source\$scope
$scope
Definition:
Source.php:21
Magento\Framework\App\Scope\Source
Definition:
Source.php:11
Magento\Framework\App\Scope\Source\toOptionArray
toOptionArray()
Definition:
Source.php:40
Magento\Framework\Option\ArrayInterface
Definition:
ArrayInterface.php:11
Magento\Framework\App\Scope
Definition:
Source.php:6
Magento\Framework\App\ScopeResolverPool
Definition:
ScopeResolverPool.php:12