cakephp/cakephp — pull request #1660 by rooseveltrp (2013-09-20 04:40:36+00:00)
Title: Added TreeBehavior::generateTreeArray(), the big brother of TreeBehavior::generateTreeList()

The method TreeBehavior::generateTreeList() generates a simple array of only the record id and name of the node and its corresponding spacer to indicate its hierarchy. However, such list might limit you to the things you can do.

So, I created a recursive method TreeBehavior::generateTreeArray(), which returns an associative array of the record. And the method also allows you to sort by any other custom fields or add other conditions if needed.

You can see a screenshot of the final output below:

![screen shot 2013-09-19 at 11 34 51 pm](https://f.cloud.github.com/assets/4078130/1178403/4c9f204e-21ae-11e3-96c9-2c59b8a00ba1.png)