/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
lib/internal/Magento/Framework/App/ResourceConnection/Config/Converter.php
35 строк
1 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 17:47
22 окт 2025, 17:47
1b769b7
Код
Авторство
О чём код?
<?php /** * Converter of resources configuration from \DOMDocument to array * * Copyright 2015 Adobe * All Rights Reserved. */ namespace Magento\Framework\App\ResourceConnection\Config; class Converter implements \Magento\Framework\Config\ConverterInterface { /** * Convert dom node tree to array * * @param \DOMDocument $source * @return array * @throws \InvalidArgumentException */ public function convert($source) { $output = []; /** @var \DOMNodeList $resources */ $resources = $source->getElementsByTagName('resource'); /** @var \DOMNode $resourceConfig */ foreach ($resources as $resourceConfig) { $resourceName = $resourceConfig->attributes->getNamedItem('name')->nodeValue; $resourceData = []; foreach ($resourceConfig->attributes as $attribute) { $resourceData[$attribute->nodeName] = $attribute->nodeValue; } $output[$resourceName] = $resourceData; } return $output; } }