Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
Config Class Reference
Inheritance diagram for Config:
Config ScopeConfigInterface

Public Member Functions

 setValue ( $path, $value, $scope=ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeCode=null)
 
 clean ()
 
 get ($configType, $path=null, $default=null)
 
- Public Member Functions inherited from Config
 __construct (ScopeCodeResolver $scopeCodeResolver, array $types=[])
 
 getValue ( $path=null, $scope=ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeCode=null)
 
 isSetFlag ($path, $scope=ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeCode=null)
 
 clean ()
 
 get ($configType, $path='', $default=null)
 

Additional Inherited Members

- Data Fields inherited from Config
const CACHE_TAG = 'CONFIG'
 
- Data Fields inherited from ScopeConfigInterface
const SCOPE_TYPE_DEFAULT = 'default'
 

Detailed Description

Definition at line 18 of file Config.php.

Member Function Documentation

◆ clean()

clean ( )

Flush all muted settings

Returns
void

Definition at line 118 of file Config.php.

119  {
120  $this->data = null;
121  $this->scopeCodeResolver = null;
122  parent::clean();
123  }

◆ get()

get (   $configType,
  $path = null,
  $default = null 
)

Definition at line 128 of file Config.php.

129  {
130  $path = $path === null ? '' : $path;
131  if (!isset($this->data[$configType]) || $this->data[$configType]->getData($path) === null) {
132  return parent::get($configType, $path, $default);
133  }
134 
135  return $this->data[$configType]->getData($path);
136  }

◆ setValue()

setValue (   $path,
  $value,
  $scope = ScopeConfigInterface::SCOPE_TYPE_DEFAULT,
  $scopeCode = null 
)

Set config value in the corresponding config scope

Parameters
string$path
mixed$value
string$scope
null | string$scopeCode
Returns
void

Definition at line 65 of file Config.php.

70  {
71  $result = $this->get('system');
72 
73  if ($scope === 'store') {
74  $scope = 'stores';
75  } elseif ($scope === 'website') {
76  $scope = 'websites';
77  }
78 
79  if (empty($scopeCode)) {
80  $scopeCode = $this->getScopeCodeResolver()->resolve($scope, $scopeCode);
81  }
82 
83  $keys = explode('/', $path);
85  $searchKeys = array_merge([$scope, $scopeCode], $keys);
86  } else {
87  $searchKeys = array_merge([$scope], $keys);
88  }
89 
90  $this->updateResult($searchKeys, $result, $value);
91  $this->setData($result, 'system');
92  }
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17
$value
Definition: gender.phtml:16

The documentation for this class was generated from the following file: