private function buildTreeFromArray(
        array $treeStructure,
        \Tx_Oelib_Visibility_Node $parentNode
    ) {
        foreach ($treeStructure as $nodeKey => $nodeContents) {
            /** @var \Tx_Oelib_Visibility_Node $childNode */
            $childNode = GeneralUtility::makeInstance(\Tx_Oelib_Visibility_Node::class);
            $parentNode->addChild($childNode);

            if (is_array($nodeContents)) {
                $this->buildTreeFromArray($nodeContents, $childNode);
            } elseif ($nodeContents === true) {
                $childNode->markAsVisible();
            }

            $this->nodes[$nodeKey] = $childNode;
        }
    }
private function buildTreeFromArray(
        array $treeStructure,
        \Tx_Oelib_Visibility_Node $parentNode
    ) {
        foreach ($treeStructure as $nodeKey => $nodeContents) {
            /** @var \Tx_Oelib_Visibility_Node $childNode */
            $childNode = GeneralUtility::makeInstance(\Tx_Oelib_Visibility_Node::class);
            $parentNode->addChild($childNode);

            if (is_array($nodeContents)) {
                $this->buildTreeFromArray($nodeContents, $childNode);
            } elseif ($nodeContents === true) {
                $childNode->markAsVisible();
            }

            $this->nodes[$nodeKey] = $childNode;
        }
    }
private function buildTreeFromArray ( array $ treeStructure , \ Tx_Oelib_Visibility_Node $ parentNode ) { foreach ( $ treeStructure as $ nodeKey => $ nodeContents ) { /** @var \Tx_Oelib_Visibility_Node $childNode */ $ childNode = GeneralUtility :: makeInstance ( \ Tx_Oelib_Visibility_Node :: class ) ; $ parentNode -> addChild ( $ childNode ) ; if ( is_array ( $ nodeContents ) ) { $ this -> buildTreeFromArray ( $ nodeContents , $ childNode ) ; } elseif ( $ nodeContents === true ) { $ childNode -> markAsVisible ( ) ; } $ this -> nodes [ $ nodeKey ] = $ childNode ; } }
Builds the node tree from the given structure.

@param array $treeStructure
the tree structure as array, may be empty
@param \Tx_Oelib_Visibility_Node $parentNode
the parent node for the current key

@return void
Builds the node tree from the given structure .