Source for file Dynamic_DBnested.php
Documentation is available at Dynamic_DBnested.php
// $Id: Dynamic_DBnested.php 175303 2004-12-21 19:59:20Z dufuz $
//ini_set('include_path',realpath(dirname(__FILE__).'/../../').':'.realpath(dirname(__FILE__).'/../../../includes').':'.ini_get('include_path'));
require_once 'Tree/Tree.php';
# $tree = Tree::setupDynamic('DBnested' , 'mysql://root@localhost/tree_test' , array('table' => 'nestedTree'));
$tree = Tree::setup ('Dynamic_DBnested' , 'mysql://root@localhost/tree_test' , array ('table' => 'nestedTree'));
$show[] = '$tree->getRoot()';
$show[] = '$tree->getElement(1)';
$show[] = '$tree->getChild(1)';
$show[] = '$tree->getPath(7)';
$show[] = '$tree->getPath(2)';
$show[] = '$tree->add(array("name"=>"c0") , 5 )';
$show[] = '$tree->remove( $res )'; // remove the last element that was added in the line before :-)
$show[] = '$tree->getRight( 5 )';
$show[] = '$tree->getLeft( 5 )';
$show[] = '$tree->getChildren( 1 )';
$show[] = '$tree->getParent( 2 )';
$show[] = '$tree->getNext( 2 )';
$show[] = '$tree->getNext( 4 )';
$show[] = '$tree->getNext( 8 )';
$show[] = '$tree->getPrevious( 2 )';
$show[] = '$tree->getPrevious( 4 )';
$show[] = '$tree->getPrevious( 8 )';
$show[] = '$tree->getPreviousId( 8 )';
$show[] = '$tree->move( 4,3 )';
foreach($show as $aRes) {
eval ("\$res=". $aRes. ';');
<a href="http://research.calacademy.org/taf/proceedings/ballew/sld029.htm">the tree structure visualisation</a>
Documentation generated on Mon, 11 Mar 2019 15:47:04 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|