Monday, December 2, 2013

Posting to the top of the tree using the Tree Behavior

I'm using the Tree Behavior in one of my models.  When a new record is added by default it post the new record at the bottom of the tree.  What I need it to do is post the new record at the top of the tree.  I've looked at the documentation and I don't see anything to change that default behavior.  I also looked at the reorder method, but I'm unsure how to use that to move a new record to the top of the tree.

If I pass the lft and rght parameters as 1 and 2 will the other records update automatically?  Any ideas on how to achieve this?

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: