Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Notification.php
Go to the documentation of this file.
1 <?php
7 
10 
14 class Notification extends \Magento\Framework\App\Config\Value
15 {
19  protected $_eventPrefix = 'tax_config_notification';
20 
24  protected $resourceConfig;
25 
36  public function __construct(
37  \Magento\Framework\Model\Context $context,
38  \Magento\Framework\Registry $registry,
40  \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList,
42  \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
43  \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
44  array $data = []
45  ) {
46  $this->resourceConfig = $resourceConfig;
47  parent::__construct($context, $registry, $config, $cacheTypeList, $resource, $resourceCollection, $data);
48  }
49 
55  public function afterSave()
56  {
57  if ($this->isValueChanged()) {
61  }
62  return parent::afterSave();
63  }
64 
71  protected function _resetNotificationFlag($path)
72  {
73  $this->resourceConfig->saveConfig($path, 0, ScopeConfigInterface::SCOPE_TYPE_DEFAULT, 0);
74  return $this;
75  }
76 }
const XML_PATH_TAX_NOTIFICATION_IGNORE_PRICE_DISPLAY
Definition: Config.php:24
$config
Definition: fraud_order.php:17
$resource
Definition: bulk.php:12
const XML_PATH_TAX_NOTIFICATION_IGNORE_DISCOUNT
Definition: Config.php:22
const XML_PATH_TAX_NOTIFICATION_IGNORE_APPLY_DISCOUNT
Definition: Config.php:26
__construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList, \Magento\Config\Model\ResourceModel\Config $resourceConfig, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])