public function serializeNodeRecursively(NodeInterface $node, ControllerContext $controllerContext)
    {
        $result = [
            $node->getContextPath() => $this->nodeInfoHelper->renderNodeWithPropertiesAndChildrenInformation($node, $controllerContext)
        ];

        if ($this->isRecursive === true) {
            foreach ($node->getChildNodes() as $childNode) {
                $result = array_merge($result, $this->serializeNodeRecursively($childNode, $controllerContext));
            }
        }

        return $result;
    }
public function serializeNodeRecursively(NodeInterface $node, ControllerContext $controllerContext)
    {
        $result = [
            $node->getContextPath() => $this->nodeInfoHelper->renderNodeWithPropertiesAndChildrenInformation($node, $controllerContext)
        ];

        if ($this->isRecursive === true) {
            foreach ($node->getChildNodes() as $childNode) {
                $result = array_merge($result, $this->serializeNodeRecursively($childNode, $controllerContext));
            }
        }

        return $result;
    }
public function serializeNodeRecursively ( NodeInterface $ node , ControllerContext $ controllerContext ) { $ result = [ $ node -> getContextPath ( ) => $ this -> nodeInfoHelper -> renderNodeWithPropertiesAndChildrenInformation ( $ node , $ controllerContext ) ] ; if ( $ this -> isRecursive === true ) { foreach ( $ node -> getChildNodes ( ) as $ childNode ) { $ result = array_merge ( $ result , $ this -> serializeNodeRecursively ( $ childNode , $ controllerContext ) ) ; } } return $ result ; }
Serialize node and all child nodes

@param NodeInterface $node
@param ControllerContext $controllerContext
@return array
Serialize node and all child nodes