1
0
mirror of synced 2024-12-15 15:46:02 +03:00
doctrine2/manual/docs/Object relational mapping - Hierarchical data - Nested set - Read me.php
2007-04-13 21:49:11 +00:00

8 lines
489 B
PHP

The most effective way to traverse a tree from the root node, is to use the tree::fetchTree() method.
It will by default include the root node in the tree and will return an iterator to traverse the tree.
To traverse a tree from a given node, it will normally cost 3 queries, one to fetch the starting node, one to fetch the branch from this node, and one to determine the level of the start node, the traversal algorithm with then determine the level of each subsequent node for you.