Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Writer.php
Go to the documentation of this file.
1 <?php
9 
11 
12 class Writer implements \Magento\Framework\App\Config\Storage\WriterInterface
13 {
19  protected $_resource;
20 
24  public function __construct(\Magento\Framework\App\Config\ConfigResource\ConfigInterface $resource)
25  {
26  $this->_resource = $resource;
27  }
28 
37  public function delete($path, $scope = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeId = 0)
38  {
39  $this->_resource->deleteConfig(rtrim($path, '/'), $scope, $scopeId);
40  }
41 
51  public function save($path, $value, $scope = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeId = 0)
52  {
53  $this->_resource->saveConfig(rtrim($path, '/'), $value, $scope, $scopeId);
54  }
55 }
$resource
Definition: bulk.php:12
$value
Definition: gender.phtml:16
__construct(\Magento\Framework\App\Config\ConfigResource\ConfigInterface $resource)
Definition: Writer.php:24
save($path, $value, $scope=ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeId=0)
Definition: Writer.php:51