protected function _parseParent($child, $data, $attributes) {
        $parent = $child->xpath("parent::*");

        if (is_object($parent[0]['name'])) {
            foreach ($attributes as $attribute) {
                $name = $attribute['name'];

                if (is_object($parent[0][$name])) {
                    /** @var SimpleXMLElement $element */
                    $element = $parent[0][$name];

                    if ($attribute['concatenate'] == true) {
                        if ($data[$name] != '') {
                            $data[$name] = $element->__toString() . $attribute['separator'] . $data[$name];
                        }
                        else {
                            $data[$name] = $element->__toString();
                        }
                    }
                    else {
                        if ($data[$name] == '') {
                            $data[$name] = $element->__toString();
                        }
                    }
                }
            }

            $data = $this->_parseParent($parent[0], $data, $attributes);
        }

        return $data;
    }
protected function _parseParent($child, $data, $attributes) {
        $parent = $child->xpath("parent::*");

        if (is_object($parent[0]['name'])) {
            foreach ($attributes as $attribute) {
                $name = $attribute['name'];

                if (is_object($parent[0][$name])) {
                    /** @var SimpleXMLElement $element */
                    $element = $parent[0][$name];

                    if ($attribute['concatenate'] == true) {
                        if ($data[$name] != '') {
                            $data[$name] = $element->__toString() . $attribute['separator'] . $data[$name];
                        }
                        else {
                            $data[$name] = $element->__toString();
                        }
                    }
                    else {
                        if ($data[$name] == '') {
                            $data[$name] = $element->__toString();
                        }
                    }
                }
            }

            $data = $this->_parseParent($parent[0], $data, $attributes);
        }

        return $data;
    }
protected function _parseParent ( $ child , $ data , $ attributes ) { $ parent = $ child -> xpath ( "parent::*" ) ; if ( is_object ( $ parent [ 0 ] [ 'name' ] ) ) { foreach ( $ attributes as $ attribute ) { $ name = $ attribute [ 'name' ] ; if ( is_object ( $ parent [ 0 ] [ $ name ] ) ) { /** @var SimpleXMLElement $element */ $ element = $ parent [ 0 ] [ $ name ] ; if ( $ attribute [ 'concatenate' ] == true ) { if ( $ data [ $ name ] != '' ) { $ data [ $ name ] = $ element -> __toString ( ) . $ attribute [ 'separator' ] . $ data [ $ name ] ; } else { $ data [ $ name ] = $ element -> __toString ( ) ; } } else { if ( $ data [ $ name ] == '' ) { $ data [ $ name ] = $ element -> __toString ( ) ; } } } } $ data = $ this -> _parseParent ( $ parent [ 0 ] , $ data , $ attributes ) ; } return $ data ; }
parse parent node
@access protected
@param $child      \SimpleXMLElement
@param $data []
@param $attributes array
@return array
@since 3.0
@package Gcs\Framework\Core\Config
parse parent node