Task:
columns:
name: string(100)
parent_id: integer
relations:
Parent:
class: Task
local: parent_id
foreign: id
foreignAlias: Subtasks
views:
103answers:
1
+1
A:
See http://www.doctrine-project.org/documentation/manual/1_1/hu/hierarchical-data
Task:
actAs: [NestedSet]
columns:
name: string(100)
You don't need to care about an parent id or anything, doctrine does the bookkeeping for you.
Larry_Croft
2010-02-24 19:33:06
@Larry_Croft,I've met a performance with `NestedSet`,can you take a look here:http://stackoverflow.com/questions/2339800/how-can-i-fetch-the-entire-tree-in-a-single-query-with-doctrine
2010-02-28 08:11:20
Already wrote something there, just comment there if you've got a question :-)
Larry_Croft
2010-02-28 13:37:13
I don't see how `getBaseQuery` will help get the tree structure with a single query?Is there a built in API that can construct the tree when all nodes are provided?
2010-02-28 18:21:05