/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
lib/internal/Magento/Framework/View/Layout/ConfigCondition.php
73 строки
2 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 17:47
22 окт 2025, 17:47
1b769b7
Код
Авторство
О чём код?
<?php /** * Copyright 2017 Adobe * All Rights Reserved. */ namespace Magento\Framework\View\Layout; use Magento\Framework\View\Layout\Condition\VisibilityConditionInterface; use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\App\ScopeResolverInterface; /** * Check that config flag is set to true, */ class ConfigCondition implements VisibilityConditionInterface { /** * Unique name. */ const NAME = 'ifconfig'; /** * @var ScopeConfigInterface */ protected $scopeConfig; /** * @var ScopeResolverInterface */ protected $scopeResolver; /** * @var string|null */ private $scopeType; /** * ConfigCondition constructor. * * @param ScopeConfigInterface $scopeConfig * @param ScopeResolverInterface $scopeResolver * @param string|null $scopeType */ public function __construct( ScopeConfigInterface $scopeConfig, ScopeResolverInterface $scopeResolver, $scopeType = null ) { $this->scopeType = $scopeType; $this->scopeConfig = $scopeConfig; $this->scopeResolver = $scopeResolver; } /** * @inheritdoc */ public function isVisible(array $arguments) { return $this->scopeConfig->isSetFlag( $arguments['configPath'], $this->scopeType, $this->scopeResolver->getScope() ); } /** * @return string */ public function getName() { return self::NAME; } }