This is more of an FYI so that anyone searching about this will come
across some new information.  In the latest 1.2 Beta there have been
some changes to the way you change an Aro element's  parent AND have
the Tree values changed at the same time.

Previously, you would use the setParent method, which belonged to the
Tree Behavior.

However this does not work anymore.

Instead, if you want to change an Aro's parent AND have the lft and
rght values automatically altered so that the Aro is correctly moved
in the tree, you have to do the following:

1. Set up a $data array in which the value for 'id' represents the
'id' of the row in the aros table whose parent you want to change.  In
addition, the value of 'parent_id' needs to represent the new value
and needs to be different from whatever existing value there is.

2. Now just do a $this->Aro->save( $data ).

The setParent method is now privatised and is called automatically by
the Tree Behavior if it detects a change in an element's 'parent_id'.
So the correct way to accomplish a node move is to use the Model's
save() and not use setParent().
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to