/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
lib/internal/Magento/Framework/App/Scope/Source.php
49 строк
1 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 17:47
22 окт 2025, 17:47
1b769b7
Код
Авторство
О чём код?
<?php /** * Copyright 2015 Adobe * All Rights Reserved. */ namespace Magento\Framework\App\Scope; use Magento\Framework\App\ScopeResolverPool; use Magento\Framework\Option\ArrayInterface; class Source implements ArrayInterface { /** * @var ScopeResolverPool */ protected $scopeResolverPool; /** * @var string */ protected $scope; /** * @param ScopeResolverPool $scopeResolverPool * @param string $scope */ public function __construct( ScopeResolverPool $scopeResolverPool, $scope ) { $this->scopeResolverPool = $scopeResolverPool; $this->scope = $scope; } /** * Return array of scope names * * @return array */ public function toOptionArray() { $scopes = $this->scopeResolverPool->get($this->scope)->getScopes(); $array = []; foreach ($scopes as $scope) { $array[] = ['value' => $scope->getId(), 'label' => $scope->getName()]; } return $array; } }