是否可以使用CakePHP Tree Behavior?從樹中刪除父節點。比方說,比如我有一個這樣的節點:cakephp樹的行爲除了子女移除父節點
<Node A>
- child 1 node A
- child 2 node A
- child 3 node A
- <Node B> (which is also a child 4 of Node A)
- child 1 node B
- child 2 node B
是否有可能得到節點A的所有chidren(使用chidren(),或在CakePHP樹行爲的任何其他功能),但排除有結果的子節點(在我們的例子中是節點B)?
有什麼想法嗎?
在此先感謝
對於非常大的結果集,這將涉及到針對數據庫的** lot **命中。另外,如果你有孩子的記錄,你可以檢查左邊和右邊的值是否連續,否則就不需要任何數據庫命中。 – joeb 2012-02-06 22:03:01