magento2-docker/app/code/IpSupply/SyncOrder/Config/Getter.php

33 lines
756 B
PHP

<?php
namespace IpSupply\SyncOrder\Config;
use IpSupply\SyncOrder\Helper;
use Magento\Framework\App\Config\ScopeConfigInterface;
class Getter
{
protected $scopeConfig;
static function get($path, $prefix = true)
{
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$configGetter = $objectManager->create(self::class);
$path = $prefix
? Helper::PREFIX . '/' . $path
: $path;
return $configGetter->getConfigValue($path);
}
public function __construct(ScopeConfigInterface $scopeConfig)
{
$this->scopeConfig = $scopeConfig;
}
public function getConfigValue($fullPath)
{
return $this->scopeConfig->getValue($fullPath);
}
}