![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/module-tax/Controller/Adminhtml/Tax/ |
<?php /** * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Tax\Controller\Adminhtml\Tax; use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\Controller\ResultFactory; class IgnoreTaxNotification extends \Magento\Tax\Controller\Adminhtml\Tax { /** * @var \Magento\Framework\App\Cache\TypeListInterface */ protected $_cacheTypeList; /** * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Tax\Api\TaxClassRepositoryInterface $taxClassService * @param \Magento\Tax\Api\Data\TaxClassInterfaceFactory $taxClassDataObjectFactory * @param \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList */ public function __construct( \Magento\Backend\App\Action\Context $context, \Magento\Tax\Api\TaxClassRepositoryInterface $taxClassService, \Magento\Tax\Api\Data\TaxClassInterfaceFactory $taxClassDataObjectFactory, \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList ) { $this->_cacheTypeList = $cacheTypeList; parent::__construct($context, $taxClassService, $taxClassDataObjectFactory); } /** * Set tax ignore notification flag and redirect back * * @return \Magento\Backend\Model\View\Result\Redirect */ public function execute() { $section = $this->getRequest()->getParam('section'); if ($section) { try { $path = 'tax/notification/ignore_' . $section; $this->_objectManager->get(\Magento\Config\Model\ResourceModel\Config::class) ->saveConfig($path, 1, ScopeConfigInterface::SCOPE_TYPE_DEFAULT, 0); } catch (\Exception $e) { $this->messageManager->addError($e->getMessage()); } } // clear the block html cache $this->_cacheTypeList->cleanType('config'); $this->_eventManager->dispatch('adminhtml_cache_refresh_type', ['type' => 'config']); /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */ $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT); return $resultRedirect->setRefererUrl(); } }