Thanks Tristan and Gordon for the response. Please excuse my ignorance but I am afraid that I am still not 100% certain when and where (and why) a node reload is required.
Gordon indicated that any time a child is added to a parent, the parent must be reloaded before the add. However, looking at the plugin unit tests, the reloads are done AFTER the add insertions. Also, on lines 115-120 of the plugin unit tests I see that $n2 is added as a new node with $root as its parent (line 116). The parent ($root) is reloaded on line 120 but so is $n1, first on line 119. Why is $n1 also reloaded in this example? Because it is also the child of a node that is getting a new child? Does this mean we have to iterate over and reload all the children of a given node when it gets a new child? What about lines 140-145. Here $n3 is added as a child of $n2. According to Gordon's instructions we should only have to reload $n2 before adding $n3 as its child. However, $n1, $n2 and $root are reloaded AFTER the child insertion. The same goes for lines 172-180 and 213-217. Here every node that was ever added to the tree is reloaded after a child insertion. Is the correct way to do it? Does this mean we have to iterate over and reload ALL the descendents of a root node when any child is inserted? I understand that this is necessary in a pre-order traversal nested tree, I just thought the plugin was doing it for me. Maybe if Tristan can explain why a reload is necessary, i.e. what is it doing, then this could help to eliminate confusion. Cheers, --peterVG > From: [email protected] > [mailto:[EMAIL PROTECTED] On Behalf Of Tristan Rivoallan > Sent: May 11, 2007 1:45 AM > To: [email protected] > Subject: [symfony-users] AW: [symfony-users] > sfPropelActAsNestedSetBehaviorPlugin -- reload() required? > > indeed, after modifying the tree, it is required to reload nodes that > were already instanciated. > > From: [email protected] > [mailto:[EMAIL PROTECTED] On Behalf Of Franke Gordon > Sent: May 10, 2007 11:09 PM > To: [email protected] > Subject: [symfony-users] AW: [symfony-users] > sfPropelActAsNestedSetBehaviorPlugin -- reload() required? > > > You must reload the object when you make something like that: > > Make $root > Add $child1 to root > ----------------------- > Add $child11 to $child1 (now you must reload the $child1 before add) > Add $child2 to root (now you must reload the root before add) > ----------------------- --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---
