src/Sulu/Component/Content/Metadata/Loader/AbstractLoader.php
protected function loadStructureTags($path, $xpath)
    {
        $result = [];

        foreach ($xpath->query($path) as $node) {
            $tag = [
                'name' => null,
                'attributes' => [],
            ];

            foreach ($node->attributes as $key => $attr) {
                if (in_array($key, ['name'])) {
                    $tag[$key] = $attr->value;
                } else {
                    $tag['attributes'][$key] = $attr->value;
                }
            }

            if (!isset($tag['name'])) {
                // this should not happen because of the XSD validation
                throw new \InvalidArgumentException('Tag does not have a name in template definition');
            }

            $result[] = $tag;
        }

        return $result;
    }
protected function loadStructureTags($path, $xpath)
    {
        $result = [];

        foreach ($xpath->query($path) as $node) {
            $tag = [
                'name' => null,
                'attributes' => [],
            ];

            foreach ($node->attributes as $key => $attr) {
                if (in_array($key, ['name'])) {
                    $tag[$key] = $attr->value;
                } else {
                    $tag['attributes'][$key] = $attr->value;
                }
            }

            if (!isset($tag['name'])) {
                // this should not happen because of the XSD validation
                throw new \InvalidArgumentException('Tag does not have a name in template definition');
            }

            $result[] = $tag;
        }

        return $result;
    }
protected function loadStructureTags ( $ path , $ xpath ) { $ result = [ ] ; foreach ( $ xpath -> query ( $ path ) as $ node ) { $ tag = [ 'name' => null , 'attributes' => [ ] , ] ; foreach ( $ node -> attributes as $ key => $ attr ) { if ( in_array ( $ key , [ 'name' ] ) ) { $ tag [ $ key ] = $ attr -> value ; } else { $ tag [ 'attributes' ] [ $ key ] = $ attr -> value ; } } if ( ! isset ( $ tag [ 'name' ] ) ) { // this should not happen because of the XSD validation throw new \ InvalidArgumentException ( 'Tag does not have a name in template definition' ) ; } $ result [ ] = $ tag ; } return $ result ; }
Loads the tags for the structure.

@param $path
@param \DOMXPath $xpath

@return array

@throws \InvalidArgumentException
Loads the tags for the structure .