Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
framework
Config
Data
ConfigData.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Framework\Config\Data
;
8
14
class
ConfigData
15
{
21
private
$fileKey;
22
28
private
$data = [];
29
35
private
$overrideWhenSave =
false
;
36
42
public
function
__construct
($fileKey)
43
{
44
$this->fileKey = $fileKey;
45
}
46
52
public
function
getFileKey
()
53
{
54
return
$this->fileKey;
55
}
56
62
public
function
getData
()
63
{
64
return
$this->data;
65
}
66
74
public
function
setOverrideWhenSave
($overrideWhenSave)
75
{
76
$this->overrideWhenSave = $overrideWhenSave;
77
}
78
85
public
function
isOverrideWhenSave
()
86
{
87
return
$this->overrideWhenSave;
88
}
89
97
public
function
set
(
$path
,
$value
)
98
{
99
$chunks = $this->expand(
$path
);
100
$data = [];
101
$element
= &$data;
102
103
while
($chunks) {
104
$key = array_shift($chunks);
105
if
($chunks) {
106
$element
[$key] = [];
107
$element
= &
$element
[$key];
108
}
else
{
109
$element
[$key] =
$value
;
110
}
111
}
112
113
$this->data = array_replace_recursive($this->data, $data);
114
}
115
125
private
function
expand(
$path
)
126
{
127
$chunks = explode(
'/'
,
$path
);
128
129
foreach
($chunks as $chunk) {
130
if
(
''
== $chunk) {
131
throw
new \InvalidArgumentException(
132
"Path '$path' is invalid. It cannot be empty nor start or end with '/'"
133
);
134
}
135
}
136
137
return
$chunks;
138
}
139
}
Magento\Framework\Config\Data\ConfigData\isOverrideWhenSave
isOverrideWhenSave()
Definition:
ConfigData.php:85
Magento\Framework\Config\Data\ConfigData\__construct
__construct($fileKey)
Definition:
ConfigData.php:42
Magento\Framework\Config\Data\ConfigData\getData
getData()
Definition:
ConfigData.php:62
Magento\Framework\Config\Data\ConfigData\setOverrideWhenSave
setOverrideWhenSave($overrideWhenSave)
Definition:
ConfigData.php:74
$value
$value
Definition:
gender.phtml:16
Magento\Framework\Config\Data\ConfigData\getFileKey
getFileKey()
Definition:
ConfigData.php:52
$path
$path
Definition:
import_with_filesystem_images.php:14
Magento\Framework\Config\Data
Definition:
ConfigData.php:7
$element
$element
Definition:
element.phtml:12