DB_NestedSet::convertTreeModel() – Convert a <1.3 tree into a 1.3 tree format


require_once 'DB/NestedSet.php';

bool DB_NestedSet::convertTreeModel ( &$orig , &$copy , integer $_parent = false , object $ )


This will convert the tree into a format needed for some new features in 1.3. Your <1.3 tree will still work without converting but some new features like preorder sorting won't work as expected.

 - Create a new node table (tb_nodes2) from the current node table (tb_nodes1) (only copy the structure).
 - Create a nested set instance of the 'old' set (NeSe1) and one of the new set (NeSe2)
 - Now you have 2 identical objects where only node_table differs
 - Call DB_NestedSet::convertTreeModel(&$orig, &$copy);
 - After that you have a cleaned up copy of tb_nodes1 inside tb_nodes2




integer $_parent

ID of the parent node (private)

object $copy

Object where the new tree is copied to

Return value

returns True uns success


throws no exceptions thrown


This function can not be called statically.

apiVersion (Previous) Creates a node before a given node (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.