Skip to content

Commit 7685834

Browse files
author
Stanislav Idolov
authored
ENGCOM-843: Make scope parameters of methods to save/delete config optional #14044
2 parents da164a0 + 600749c commit 7685834

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

app/code/Magento/Config/Model/ResourceModel/Config.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Config\Model\ResourceModel;
77

8+
use Magento\Framework\App\Config\ScopeConfigInterface;
9+
810
/**
911
* Core Resource Resource Model
1012
*
@@ -34,7 +36,7 @@ protected function _construct()
3436
* @param int $scopeId
3537
* @return $this
3638
*/
37-
public function saveConfig($path, $value, $scope, $scopeId)
39+
public function saveConfig($path, $value, $scope = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeId = 0)
3840
{
3941
$connection = $this->getConnection();
4042
$select = $connection->select()->from(
@@ -70,7 +72,7 @@ public function saveConfig($path, $value, $scope, $scopeId)
7072
* @param int $scopeId
7173
* @return $this
7274
*/
73-
public function deleteConfig($path, $scope, $scopeId)
75+
public function deleteConfig($path, $scope = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeId = 0)
7476
{
7577
$connection = $this->getConnection();
7678
$connection->delete(

lib/internal/Magento/Framework/App/Config/ConfigResource/ConfigInterface.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Framework\App\Config\ConfigResource;
77

8+
use Magento\Framework\App\Config\ScopeConfigInterface;
9+
810
/**
911
* Resource for storing store configuration values
1012
*/
@@ -19,7 +21,7 @@ interface ConfigInterface
1921
* @param int $scopeId
2022
* @return $this
2123
*/
22-
public function saveConfig($path, $value, $scope, $scopeId);
24+
public function saveConfig($path, $value, $scope = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeId = 0);
2325

2426
/**
2527
* Delete config value from the storage resource
@@ -29,5 +31,5 @@ public function saveConfig($path, $value, $scope, $scopeId);
2931
* @param int $scopeId
3032
* @return $this
3133
*/
32-
public function deleteConfig($path, $scope, $scopeId);
34+
public function deleteConfig($path, $scope = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeId = 0);
3335
}

0 commit comments

Comments
 (0)