Search code examples
symfony1propelnested-sets

Symfony Propel Nested Set


I get the tree in symfony with propel with this way:

$tree = FoldersQuery::create()->findTree();

Now, how to list the tree with each child properly? I want parents be on a specific div, children on an another div and list them. But how? How to get the relationships between each item and know how to render it?

Thanks a lot.


Solution

  • You should read this documentation http://www.propelorm.org/behaviors/nested-set.

    You can get all children with getChildren(), know whether it's a root node or not with isRoot(), know the level, ... See more on the API section, it will help you :)