arms
Well-known member
I'm trying to get the node list of node_id =2 and all its children
I'm using:
Is this the best way?
I'm using:
PHP:
$nodeRepo = $this->getNodeRepo();
$nodes = $nodeRepo->getNodeList();
$nodeTree = count($nodes) ? $nodeRepo->createNodeTree($nodes) : null;//
$nodeTree = $nodeTree->filter(null, function($id, $node, $depth, $children, $tree)
{
return ($children || $node->parent_node_id == '2');
});
Is this the best way?