Skip to content

Commit

Permalink
🔃 [EngCom] Public Pull Requests - 2.1-develop
Browse files Browse the repository at this point in the history
Accepted Public Pull Requests:
 - #17083: [Backport] Make scope parameters of methods to save/delete config optional (by @mageprince)
  • Loading branch information
Stanislav Idolov authored Aug 14, 2018
2 parents 1eb2698 + ac9c5b4 commit 87f0927
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions app/code/Magento/Config/Model/ResourceModel/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*/
namespace Magento\Config\Model\ResourceModel;

use Magento\Framework\App\Config\ScopeConfigInterface;

/**
* Core Resource Resource Model
*
Expand Down Expand Up @@ -32,7 +34,7 @@ protected function _construct()
* @param int $scopeId
* @return $this
*/
public function saveConfig($path, $value, $scope, $scopeId)
public function saveConfig($path, $value, $scope = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeId = 0)
{
$connection = $this->getConnection();
$select = $connection->select()->from(
Expand Down Expand Up @@ -68,7 +70,7 @@ public function saveConfig($path, $value, $scope, $scopeId)
* @param int $scopeId
* @return $this
*/
public function deleteConfig($path, $scope, $scopeId)
public function deleteConfig($path, $scope = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeId = 0)
{
$connection = $this->getConnection();
$connection->delete(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*/
namespace Magento\Framework\App\Config\ConfigResource;

use Magento\Framework\App\Config\ScopeConfigInterface;

/**
* Resource for storing store configuration values
*/
Expand All @@ -19,7 +21,7 @@ interface ConfigInterface
* @param int $scopeId
* @return $this
*/
public function saveConfig($path, $value, $scope, $scopeId);
public function saveConfig($path, $value, $scope = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeId = 0);

/**
* Delete config value from the storage resource
Expand All @@ -29,5 +31,5 @@ public function saveConfig($path, $value, $scope, $scopeId);
* @param int $scopeId
* @return $this
*/
public function deleteConfig($path, $scope, $scopeId);
public function deleteConfig($path, $scope = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeId = 0);
}

0 comments on commit 87f0927

Please sign in to comment.