I have been working on a similar class (not specifically for CI) to deal with mptt. The one function I am stuck on atm is moving nodes from one branch to an entirely different branch. The class isn’t as ‘functional’ per se as yours, I do not provide all the helper functions.
Right now it provides the following basic functionality:
- inserts nodes
- deletes a node and all of its sub nodes
- deletes a node and moves all of its sub nodes up
The last real thing I need to accomplish is moving a node from one part of a tree to another.
Go check it out: http://ioreader.com/code/mptt.phps
PS:
This is a standalone class that can be configured for any database table. The requirement for that table is that it have a primary key, a column for a left it, and a column for a right id. The column names are irrelevant.
At the moment, it only uses mysql; however, I have isolated those functions enough that making it use the CI db would be a cinch. Also, the configure function currently truncates the table for debugging purposes.
