Definition at line 38 of file Xml.php.
◆ _addBranch()
_addBranch |
( |
Zend_Config |
$config, |
|
|
SimpleXMLElement |
$xml, |
|
|
SimpleXMLElement |
$parent |
|
) |
| |
|
protected |
Add a branch to an XML object recursively
- Parameters
-
Zend_Config | $config | |
SimpleXMLElement | $xml | |
SimpleXMLElement | $parent | |
- Returns
- void
Definition at line 88 of file Xml.php.
93 if ($branchType ===
null) {
94 if (is_numeric($key)) {
95 $branchType =
'numeric';
96 $branchName = $xml->getName();
99 unset($parent->{$branchName});
101 $branchType =
'string';
103 }
else if ($branchType !== (is_numeric($key) ?
'numeric' :
'string')) {
104 #require_once 'Zend/Config/Exception.php'; 108 if ($branchType ===
'numeric') {
110 $child = $parent->addChild($branchName);
114 $parent->addChild($branchName, (
string)
$value);
118 $child = $xml->addChild($key);
122 $xml->addChild($key, (
string)
$value);
_addBranch(Zend_Config $config, SimpleXMLElement $xml, SimpleXMLElement $parent)
◆ render()
Render a Zend_Config into a XML config string.
- Since
- 1.10
- Returns
- string
Definition at line 46 of file Xml.php.
49 $extends = $this->_config->getExtends();
50 $sectionName = $this->_config->getSectionName();
52 if (is_string($sectionName)) {
53 $child = $xml->addChild($sectionName);
55 $this->
_addBranch($this->_config, $child, $xml);
57 foreach ($this->_config as $sectionName =>
$data) {
59 $xml->addChild($sectionName, (
string)
$data);
61 $child = $xml->addChild($sectionName);
63 if (isset($extends[$sectionName])) {
72 $dom = dom_import_simplexml($xml)->ownerDocument;
73 $dom->formatOutput =
true;
75 $xmlString = $dom->saveXML();
_addBranch(Zend_Config $config, SimpleXMLElement $xml, SimpleXMLElement $parent)
The documentation for this class was generated from the following file:
- vendor/magento/zendframework1/library/Zend/Config/Writer/Xml.php