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
module-analytics
ReportXml
Config
Converter
Xml.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Analytics\ReportXml\Config\Converter
;
7
8
use
Magento\Framework\Config\ConverterInterface
;
9
15
class
Xml
implements
ConverterInterface
16
{
23
private
function
convertNode(\DOMNode
$source
)
24
{
25
$result
= [];
26
if
(
$source
->hasAttributes()) {
27
$attrs =
$source
->attributes;
28
foreach
($attrs as
$attr
) {
29
$result
[
$attr
->name] =
$attr
->value;
30
}
31
}
32
if
(
$source
->hasChildNodes()) {
33
$children
=
$source
->childNodes;
34
if
(
$children
->length == 1) {
35
$child =
$children
->item(0);
36
if
($child->nodeType == XML_TEXT_NODE) {
37
$result
[
'_value'
] = $child->nodeValue;
38
return
count(
$result
) == 1 ?
$result
[
'_value'
] :
$result
;
39
}
40
}
41
foreach
(
$children
as $child) {
42
if
($child instanceof \DOMCharacterData) {
43
continue
;
44
}
45
$result
[$child->nodeName][] = $this->convertNode($child);
46
}
47
}
48
return
$result
;
49
}
50
57
public
function
convert
(
$source
)
58
{
59
return
$this->convertNode(
$source
);
60
}
61
}
$result
$result
Definition:
product_configurable_not_available_rollback.php:26
Magento\Analytics\ReportXml\Config\Converter\Xml
Definition:
Xml.php:15
Magento\Analytics\ReportXml\Config\Converter\Xml\convert
convert($source)
Definition:
Xml.php:57
$attr
$attr
Definition:
text.phtml:8
$source
$source
Definition:
source.php:23
Magento\Analytics\ReportXml\Config\Converter
Definition:
Xml.php:6
$children
$children
Definition:
actions.phtml:11
Magento\Framework\Config\ConverterInterface
Definition:
ConverterInterface.php:14