-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathConfig.php
52 lines (41 loc) · 1.54 KB
/
Config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
declare(strict_types=1);
namespace CustomGento\Cookiebot\Model;
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Store\Model\ScopeInterface;
class Config
{
public const XML_PATH_COOKIEBOT_ENABLED = 'web/cookiebot/enabled';
public const XML_PATH_COOKIEBOT_ID = 'web/cookiebot/id';
public const XML_PATH_DATA_CULTURE = 'web/cookiebot/data_culture';
public const XML_PATH_USE_EU_CDN = 'web/cookiebot/use_eu_cdn';
public const XML_PATH_USE_GOOGLE_CONSENT_MODE = 'web/cookiebot/use_google_consent_mode';
/**
* @var ScopeConfigInterface
*/
private $scopeConfig;
public function __construct(ScopeConfigInterface $scopeConfig)
{
$this->scopeConfig = $scopeConfig;
}
public function isEnabled(): bool
{
return $this->scopeConfig->isSetFlag(self::XML_PATH_COOKIEBOT_ENABLED, ScopeInterface::SCOPE_STORE);
}
public function getId(): string
{
return (string)$this->scopeConfig->getValue(self::XML_PATH_COOKIEBOT_ID, ScopeInterface::SCOPE_STORE);
}
public function getDataCulture(): string
{
return (string)$this->scopeConfig->getValue(self::XML_PATH_DATA_CULTURE, ScopeInterface::SCOPE_STORE);
}
public function useEuCdn(): bool
{
return $this->scopeConfig->isSetFlag(self::XML_PATH_USE_EU_CDN, ScopeInterface::SCOPE_STORE);
}
public function isGoogleConsentModeEnabled(): bool
{
return $this->scopeConfig->isSetFlag(self::XML_PATH_USE_GOOGLE_CONSENT_MODE, ScopeInterface::SCOPE_STORE);
}
}