Manually Building a Tree in CakePHP
Posted
by mabwi
on Stack Overflow
See other posts from Stack Overflow
or by mabwi
Published on 2009-12-02T01:58:25Z
Indexed on
2010/04/28
20:47 UTC
Read the original article
Hit count: 195
I'm currently working on building an application in CakePHP. There's a quite extensive existing data set that's conceptually a tree, but wasn't previously stored as one. What I mean by that, is there's no real relationship defined in the data.
The problem I'm having is getting it to work correctly with the CakePHP tree behaviour. Because I have to set all the values on existing data - as opposed to Cake setting up the structure as elements are inserted - I need to understand how the lft/rght values work.
So, I guess the question is:
How does the structure data work, specifically the lft/rght values? How do I set it up so that the data comes out rationally, without inserting them one at a time? It's a 2 level tree, with Sections and sub-sections.
Thanks for the help
© Stack Overflow or respective owner