Sulu\Component\Content\Metadata\Loader\XmlLegacyLoader::loadMeta PHP Method

loadMeta() private method

private loadMeta ( $path, DOMXPath $xpath, DOMNode $context = null )
$xpath DOMXPath
$context DOMNode
    private function loadMeta($path, \DOMXPath $xpath, \DOMNode $context = null)
    {
        $result = [];
        /** @var \DOMElement $node */
        foreach ($xpath->query($path, $context) as $node) {
            $attribute = $node->tagName;
            $lang = $this->getValueFromXPath('@lang', $xpath, $node);
            if (!isset($result[$node->tagName])) {
                $result[$attribute] = [];
            }
            $result[$attribute][$lang] = $node->textContent;
        }
        return $result;
    }