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

        foreach ($xpath->query($path) as $node) {
            $area = [];

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

            $meta = $this->loadMeta('x:meta/x:*', $xpath, $node);
            $area['title'] = $meta['title'];

            if (!isset($area['key'])) {
                // this should not happen because of the XSD validation
                throw new \InvalidArgumentException('Zone does not have a key in the attributes');
            }

            $result[] = $area;
        }

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

        foreach ($xpath->query($path) as $node) {
            $area = [];

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

            $meta = $this->loadMeta('x:meta/x:*', $xpath, $node);
            $area['title'] = $meta['title'];

            if (!isset($area['key'])) {
                // this should not happen because of the XSD validation
                throw new \InvalidArgumentException('Zone does not have a key in the attributes');
            }

            $result[] = $area;
        }

        return $result;
    }
protected function loadStructureAreas ( $ path , $ xpath ) { $ result = [ ] ; foreach ( $ xpath -> query ( $ path ) as $ node ) { $ area = [ ] ; foreach ( $ node -> attributes as $ key => $ attr ) { if ( in_array ( $ key , [ 'key' ] ) ) { $ area [ $ key ] = $ attr -> value ; } else { $ area [ 'attributes' ] [ $ key ] = $ attr -> value ; } } $ meta = $ this -> loadMeta ( 'x:meta/x:*' , $ xpath , $ node ) ; $ area [ 'title' ] = $ meta [ 'title' ] ; if ( ! isset ( $ area [ 'key' ] ) ) { // this should not happen because of the XSD validation throw new \ InvalidArgumentException ( 'Zone does not have a key in the attributes' ) ; } $ result [ ] = $ area ; } return $ result ; }
Loads the areas for the structure.

@param $path
@param \DOMXPath $xpath

@return array

@throws \InvalidArgumentException
Loads the areas for the structure .