Location: PHPKode > scripts > Nested Set DB Table > tests/1/DbTable/NestedCategory.php
<?php
include_once('NestedSetDbTable/Abstract.php');

/**
 * Demo db table class (model), which extends 
 * NestedSetDbTable_Abstract.
 *
 * @author Nikola Posa <hide@address.com>
 * @license http://opensource.org/licenses/gpl-3.0.html GNU General Public License
 */
class DbTable_NestedCategory extends NestedSetDbTable_Abstract
{
	//We can provide our table info in class definition:
	
	/**
     * Table name.
     *
     * @var string
     */
    protected $_name = 'nested_category';
	
	/**
     * Name of the primary key column.
     *
     * @var string
     */
    protected $_primary = 'category_id';
	
    /**
     * Left column name.
     *
     * @var string
     */
    protected $_left = 'lft';
 
    /**
     * Right column name.
     *
     * @var string
     */
    protected $_right = 'rgt';
	
	//And for this example, that is all we need! We can now use methods that are provided in NestedSetDbTable_Abstract class.
}
?>
Return current item: Nested Set DB Table