-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathData.php
More file actions
65 lines (59 loc) · 1.67 KB
/
Data.php
File metadata and controls
65 lines (59 loc) · 1.67 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
namespace ActiveCampaign\SyncLog\Helper;
use Magento\Framework\App\Helper\AbstractHelper;
use Magento\Framework\App\Helper\Context;
use Magento\Store\Model\ScopeInterface;
class Data extends AbstractHelper
{
const ACTIVE_CAMPAIGN_SYNCLOG_MODE = "active_campaign/synclog/synclog_mode";
const ACTIVE_CAMPAIGN_REMOVE_AFTER_DAYS = "active_campaign/synclog/remove_after_days";
const XML_PATH_ACTIVE_CAMPAIGN_SYNCLOG_ENABLE = "active_campaign/synclog/synclog_delete";
/**
* @var \Magento\Framework\App\State *
*/
private $state;
/**
* Data constructor.
*
* @param Context $context
*/
public function __construct(
Context $context,
\Magento\Framework\App\State $state
) {
parent::__construct($context);
$this->state = $state;
}
public function removeAfterDays(?string $scopeCode = null)
{
return $this->scopeConfig->getValue(
self::ACTIVE_CAMPAIGN_REMOVE_AFTER_DAYS,
ScopeInterface::SCOPE_STORES,
$scopeCode
);
}
/**
* @param null $scopeCode
* @return bool
*/
public function isLogError(?string $scopeCode = null)
{
return $this->scopeConfig->isSetFlag(
self::ACTIVE_CAMPAIGN_SYNCLOG_MODE,
ScopeInterface::SCOPE_STORES,
$scopeCode
);
}
/**
* @param null $scopeCode
* @return bool
*/
public function isDeletingEnabled($scopeCode = null): bool
{
return $this->scopeConfig->isSetFlag(
self::XML_PATH_ACTIVE_CAMPAIGN_SYNCLOG_ENABLE,
ScopeInterface::SCOPE_STORES,
$scopeCode
);
}
}