From Joomla! Documentation

Revision as of 21:11, 24 March 2017 by JoomlaWikiBot (talk | contribs) (preparing for archive only)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

JTableNested is a table class which supports modified pre-order tree traversal behaviour. This class is derived from the base JTable class and adds methods to support a binary tree structure in the database, with pre-order being the preferred method of traversal.

Defined in[edit]



Method name Description
debug Sets the debug level on or off
getPath Method to get an array of nodes from a given node to its root.
getTree Method to get a node and all its child nodes.
isLeaf Method to determine if a node is a leaf node in the tree (has no children).
setLocation Method to set the location of a node in the tree object. This method does not save the new location to the database, but will set it in the object so that when the node is stored it will be stored in the new location.
move Method to move a node and its children to a new location in the tree.
delete Method to delete a node, and optionally its child nodes, from the table.
check Asset that the nested set data is valid.
store Method to store a node in the database table.
publish Method to set the publishing state for a node or list of nodes in the database table. The method respects rows checked out by other users and will attempt to checkin rows that it can after adjustments are made. The method will now allow you to set a publishing state higher than any ancestor node and will not allow you to set a publishing state on a node with a checked out child.
orderUp Method to move a node one position to the left in the same level.
orderDown Method to move a node one position to the right in the same level.
getRootId Gets the ID of the root item in the tree
rebuild Method to recursively rebuild the whole nested set tree.
rebuildPath Method to rebuild the node's path field from the alias values of the nodes from the current node to the root node of the tree.


jimport( 'joomla.database.tablenested' );


Code Examples[edit]