https://911datasets.org/index.php/Nested_Sets_AKA_Modified_Pre-order_Tree_Traversal
Implementation for laravel, maybe it is good time to start thinking about something like this in phalcon https://github.com/cartalyst/nesty
|
Jan '15 |
10 |
2950 |
8 |
https://911datasets.org/index.php/Nested_Sets_AKA_Modified_Pre-order_Tree_Traversal
Implementation for laravel, maybe it is good time to start thinking about something like this in phalcon https://github.com/cartalyst/nesty
hi, for sure, a core implementation of uch a feature would be great, because who have never had to deal with data trees ? But, my two cents, adjacent tree and nested sets are two differents kind of approach. The first one is good if you have a lot of tree manipulation to do but is not appropriate for big trees. The second one is quiet ressources consumming when manipulating the tree, but is excellent for querying it. Morality: you will have to devellop these two approaches ;-)
BW, here are two php libraries for tree handling: nested sets: https://www.sideralis.org/baobab/index.html there's also a pear package : https://pear.php.net/manual/en/package.DB_NestedSet.php adjacent list: https://www.pdvictor.com/?sv=&category=just+code&title=adjacency+model
cheers
maybe better to use in adjacent list path lists? examples of implementations
https://kod34fr33.wordpress.com/2008/05/06/adjacency-list-tree-on-mysql/ https://www.depesz.com/2008/04/11/my-take-on-trees-in-sql/
Hi, Is any chance to implement in core of Phalcon MPTT pattern? Good explanation: https://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/
this is my attempt to implementing MPTT pattern, there is still a lot work to do, love to hear ideas from you guys https://gist.github.com/bendo01/7014197
... I've never read this thread until now..so i've done an attempt of MPTT implementation too. u_u Here is my gihtub repository : https://github.com/lunaticPenguin/LeftRightTreeTraversal
Hope it can helps someone. I'm totally open minded to receive critics on my code (please do not hesitate). Otherwise Baobab seems to be really good.
-- Benny Leonard Enrico Panggabean> The first thing I can say about your work is that it's not really reusable for other projects or areas in your own project. I think if you did it generical, this would be cool ;) Also your code needs some comments.
@Corentin Legros thank you for sharing your code, and in reply to your comment, yes i will put some comments later on after testing it first, to put in generic i was confused to chose either to change it into traits or change it into behavior :)
I've ported last gist into behavior is not fully finish and still a lot work to do, I'm totally open minded to receive critics on my code (please do not hesitate). for details you can see it here : https://github.com/bendo01/Phalcon-TreeBehavior