[symfony-users] Re: Nested Set without single root?
Hi Daniel, Richtermeister schrieb: Hey guys, thanks for the responses, but now I'm confused.. If I call make-root on a new node, and do that with many nodes (supposedly my root layer) they all have 1 as left, and thus this can't be right. Having a common root works, but semantically it doesn't sit well with me. Somehow I never get an answer to the rebuild right and left question. Does everybody build their trees from scratch? I'm certain I have seen a code snippet on this (probably on the symfony snippet page) but for the life of me I can't find it anymore. But it should give you a good starting point if you can find it :) Cheers, Georg Thanks though, I keep digging. Daniel On Mar 26, 6:36 am, gestadieu [EMAIL PROTECTED] wrote: I am not sure you can simply modify your node (or do it manually in the db!) but for sure the plugin allows you to have several root like you want to do. On Mar 26, 12:49 pm, Richtermeister [EMAIL PROTECTED] wrote: Hi all, I'm trying the propel nested set behavior for the first time, and I was wondering if there always has to be one single root node, or if multiple nodes (in the same scope) can be at the root. For example, I'm trying to use a category table such as this: - makeup -- -- anti-aging -- -- mascara - lotions -- -- moisturizing -- -- sunscreen - nail-polish where makeup, lotions, and nailpolish are the root categories.. while I was just using the adjacent list method, that was no problem, but now I have a hard time putting nodes at the root. If I call makeRoot() on an existing node, I get an exception. Also, I was wondering how I would convert an existing hierarchy from an ajacent list to a nested set, so I don't have to re-build the tree through the app. It seems the right and left values can always be rebuild from the parent id alone.. shouldn't there be a function like this bundled with the plugin? Thanks for all help, I'm looking forward to figure this out better. Have a great night, Daniel --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Nested Set without single root?
I am not sure you can simply modify your node (or do it manually in the db!) but for sure the plugin allows you to have several root like you want to do. On Mar 26, 12:49 pm, Richtermeister [EMAIL PROTECTED] wrote: Hi all, I'm trying the propel nested set behavior for the first time, and I was wondering if there always has to be one single root node, or if multiple nodes (in the same scope) can be at the root. For example, I'm trying to use a category table such as this: - makeup -- -- anti-aging -- -- mascara - lotions -- -- moisturizing -- -- sunscreen - nail-polish where makeup, lotions, and nailpolish are the root categories.. while I was just using the adjacent list method, that was no problem, but now I have a hard time putting nodes at the root. If I call makeRoot() on an existing node, I get an exception. Also, I was wondering how I would convert an existing hierarchy from an ajacent list to a nested set, so I don't have to re-build the tree through the app. It seems the right and left values can always be rebuild from the parent id alone.. shouldn't there be a function like this bundled with the plugin? Thanks for all help, I'm looking forward to figure this out better. Have a great night, Daniel --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Nested Set without single root?
Hey guys, thanks for the responses, but now I'm confused.. If I call make-root on a new node, and do that with many nodes (supposedly my root layer) they all have 1 as left, and thus this can't be right. Having a common root works, but semantically it doesn't sit well with me. Somehow I never get an answer to the rebuild right and left question. Does everybody build their trees from scratch? Thanks though, I keep digging. Daniel On Mar 26, 6:36 am, gestadieu [EMAIL PROTECTED] wrote: I am not sure you can simply modify your node (or do it manually in the db!) but for sure the plugin allows you to have several root like you want to do. On Mar 26, 12:49 pm, Richtermeister [EMAIL PROTECTED] wrote: Hi all, I'm trying the propel nested set behavior for the first time, and I was wondering if there always has to be one single root node, or if multiple nodes (in the same scope) can be at the root. For example, I'm trying to use a category table such as this: - makeup -- -- anti-aging -- -- mascara - lotions -- -- moisturizing -- -- sunscreen - nail-polish where makeup, lotions, and nailpolish are the root categories.. while I was just using the adjacent list method, that was no problem, but now I have a hard time putting nodes at the root. If I call makeRoot() on an existing node, I get an exception. Also, I was wondering how I would convert an existing hierarchy from an ajacent list to a nested set, so I don't have to re-build the tree through the app. It seems the right and left values can always be rebuild from the parent id alone.. shouldn't there be a function like this bundled with the plugin? Thanks for all help, I'm looking forward to figure this out better. Have a great night, Daniel --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---