Modified Preorder Tree Traversal library for Kohana ORM.
Pull request Compare This branch is 3 commits ahead, 1 commit behind evopix:KO3.1/master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

This forks aims to make MPTT work with Kohana 3.2

So far we've only fixed things, so usage is the same than before

MPTT Library, extends ORM


Place module in /modules/ and include the call in your bootstrap.

Declaring your ORM object

class Model_Category extends ORM_MPTT {

Usage Examples

Creating a root node:

$cat = ORM::factory('Category_Mptt');
$cat->name = 'Music';
echo 'Category ID'.$mptt->id.' set at level '.$cat->lvl.' (scope: '.$cat->scope.')';
$c1 = $cat; // Saving id for next example

Creating a child node:

$cat->clear(); // Clearing ORM object
$cat->name = 'Terminology';