|
| __construct (\Magento\Framework\App\Config\ReinitableConfigInterface $config, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Config\Model\Config\Structure $configStructure, \Magento\Framework\DB\TransactionFactory $transactionFactory, \Magento\Config\Model\Config\Loader $configLoader, \Magento\Framework\App\Config\ValueFactory $configValueFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, SettingChecker $settingChecker=null, array $data=[]) |
|
| load () |
|
| extendConfig ($path, $full=true, $oldConfig=[]) |
|
| setDataByPath ($path, $value) |
|
| getConfigDataValue ($path, &$inherit=null, $configData=null) |
|
| __construct (array $data=[]) |
|
| addData (array $arr) |
|
| setData ($key, $value=null) |
|
| unsetData ($key=null) |
|
| getData ($key='', $index=null) |
|
| getDataByPath ($path) |
|
| getDataByKey ($key) |
|
| setDataUsingMethod ($key, $args=[]) |
|
| getDataUsingMethod ($key, $args=null) |
|
| hasData ($key='') |
|
| toArray (array $keys=[]) |
|
| convertToArray (array $keys=[]) |
|
| toXml (array $keys=[], $rootName='item', $addOpenTag=false, $addCdata=true) |
|
| convertToXml (array $arrAttributes=[], $rootName='item', $addOpenTag=false, $addCdata=true) |
|
| toJson (array $keys=[]) |
|
| convertToJson (array $keys=[]) |
|
| toString ($format='') |
|
| __call ($method, $args) |
|
| isEmpty () |
|
| serialize ($keys=[], $valueSeparator='=', $fieldSeparator=' ', $quote='"') |
|
| debug ($data=null, &$objects=[]) |
|
| offsetSet ($offset, $value) |
|
| offsetExists ($offset) |
|
| offsetUnset ($offset) |
|
| offsetGet ($offset) |
|
Backend config model
Used to save configuration
- Author
- Magento Core Team core@.nosp@m.mage.nosp@m.ntoco.nosp@m.mmer.nosp@m.ce.co.nosp@m.m @SuppressWarnings(PHPMD.CouplingBetweenObjects) @api
- Since
- 100.0.2
Definition at line 22 of file Config.php.
◆ __construct()
- Parameters
-
\Magento\Framework\App\Config\ReinitableConfigInterface | $config | |
\Magento\Framework\Event\ManagerInterface | $eventManager | |
\Magento\Config\Model\Config\Structure | $configStructure | |
\Magento\Framework\DB\TransactionFactory | $transactionFactory | |
\Magento\Config\Model\Config\Loader | $configLoader | |
\Magento\Framework\App\Config\ValueFactory | $configValueFactory | |
\Magento\Store\Model\StoreManagerInterface | $storeManager | |
Config\Reader\Source\Deployed\SettingChecker | null | $settingChecker | |
array | $data | |
Definition at line 101 of file Config.php.
112 parent::__construct(
$data);
113 $this->_eventManager = $eventManager;
114 $this->_configStructure = $configStructure;
115 $this->_transactionFactory = $transactionFactory;
117 $this->_configLoader = $configLoader;
118 $this->_configValueFactory = $configValueFactory;
◆ _checkSingleStoreMode()
Set correct scope if isSingleStoreMode = true
- Parameters
-
\Magento\Config\Model\Config\Structure\Element\Field | $fieldConfig | |
\Magento\Framework\App\Config\ValueInterface | $dataObject | |
- Returns
- void
Definition at line 568 of file Config.php.
572 $isSingleStoreMode = $this->_storeManager->isSingleStoreMode();
573 if (!$isSingleStoreMode) {
576 if (!$fieldConfig->showInDefault()) {
577 $websites = $this->_storeManager->getWebsites();
578 $singleStoreWebsite = array_shift(
$websites);
579 $dataObject->setScope(
'websites');
580 $dataObject->setWebsiteCode($singleStoreWebsite->getCode());
581 $dataObject->setScopeCode($singleStoreWebsite->getCode());
582 $dataObject->setScopeId($singleStoreWebsite->getId());
◆ _getConfig()
_getConfig |
( |
|
$full = true | ) |
|
|
protected |
Return formatted config data for current section
- Parameters
-
bool | $full | Simple config structure or not |
- Returns
- array
Definition at line 551 of file Config.php.
553 return $this->_configLoader->getConfigByPath(
◆ extendConfig()
extendConfig |
( |
|
$path, |
|
|
|
$full = true , |
|
|
|
$oldConfig = [] |
|
) |
| |
Extend config data with additional config data by specified path
- Parameters
-
string | $path | Config path prefix |
bool | $full | Simple config structure or not |
array | $oldConfig | Config data to extend |
- Returns
- array
Definition at line 463 of file Config.php.
465 $extended = $this->_configLoader->getConfigByPath(
$path, $this->getScope(), $this->getScopeId(), $full);
466 if (is_array($oldConfig) && !empty($oldConfig)) {
467 return $oldConfig + $extended;
◆ getConfigDataValue()
getConfigDataValue |
( |
|
$path, |
|
|
& |
$inherit = null , |
|
|
|
$configData = null |
|
) |
| |
Get config data value
- Parameters
-
string | $path | |
null | bool | &$inherit | |
null | array | $configData | |
- Returns
- \Magento\Framework\Simplexml\Element
Definition at line 594 of file Config.php.
604 $data = $this->_appConfig->getValue(
$path, $this->getScope(), $this->getScopeCode());
◆ load()
Load config data for section
- Returns
- array
Definition at line 446 of file Config.php.
448 if ($this->_configData ===
null) {
450 $this->_configData = $this->
_getConfig(
false);
◆ setDataByPath()
setDataByPath |
( |
|
$path, |
|
|
|
$value |
|
) |
| |
Add data by path section/group/field
- Parameters
-
- Returns
- void
- Exceptions
-
Definition at line 480 of file Config.php.
484 throw new \UnexpectedValueException(
'Path must not be empty');
486 $pathParts = explode(
'/',
$path);
487 $keyDepth = count($pathParts);
488 if ($keyDepth !== 3) {
489 throw new \UnexpectedValueException(
490 "Allowed depth of configuration is 3 (<section>/<group>/<field>). Your configuration depth is " 491 . $keyDepth .
" for path '$path'" 495 'section' => $pathParts[0],
499 $pathParts[2] => [
'value' =>
$value],
◆ $_appConfig
◆ $_configData
◆ $_configLoader
◆ $_configStructure
◆ $_configValueFactory
◆ $_eventManager
◆ $_objectFactory
◆ $_storeManager
◆ $_transactionFactory
The documentation for this class was generated from the following file: