JTableNested

From Joomla! Documentation
(Difference between revisions)
Jump to: navigation, search
m (Added availability section.)
(Bulk upload by Doxiki2)
Line 1: Line 1:
'''JTableNested''' is a table class which supports modified pre-order [[wikipedia:tree traversal|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.
+
This class is available in the following Joomla versions:-
===Availability===
+
<splist showpath=notparent />
{{JVer|1.6|From Joomla 1.6}}
+
<noinclude>[[Category:Framework]][[Category:JTableNested]]</noinclude>
 
+
===Defined in===
+
/joomla/database/tablenested.php
+
 
+
===Extends===
+
* [[JTable]]
+
 
+
===Reserved Database Field Names===
+
The operation of this class is dependent on the existence of specially-named fields (columns) in the database table.
+
{| class="wikitable"
+
|-
+
!Field name
+
!Description
+
|-
+
|left_id
+
|Primary key of the node on the left branch of the current node.
+
|-
+
|right_id
+
|Primary key of the node on the right branch of the current node.
+
|-
+
|parent_id
+
|Primary key of the parent node of the current node.
+
|-
+
|level
+
|Number of steps from the root node to the current node.
+
|-
+
|path
+
|Path from the root node to the current node.
+
|-
+
|alias
+
|Optional.  Alias name for the current node.
+
|-
+
|checked_out
+
|Optional.  As per [[JTable]].
+
|-
+
|checked_out_time
+
|Optional.  As per [[JTable]].
+
|-
+
|published
+
|Optional.  As per [[JTable]].
+
|}
+
 
+
===Methods===
+
{| class="wikitable"
+
|-
+
!Method name
+
!Description
+
|-
+
|[[JTableNested/delete|delete]]
+
|Deletes a node, and optionally its child nodes, from the table.
+
|-
+
|[[JTableNested/getPath|getPath]]
+
|Gets and array of nodes from the root to a given node.
+
|-
+
|[[JTableNested/getTree|getTree]]
+
|Gets a node and all its child nodes.
+
|-
+
|[[JTableNested/isLeaf|isLeaf]]
+
|Determines if a node is a leaf node in the tree (has no children).
+
|-
+
|[[JTableNested/move|move]]
+
|Moves a node and its children to a new location in the tree.
+
|-
+
|[[JTableNested/orderDown|orderDown]]
+
|Moves a node one position to the right in the same level.
+
|-
+
|[[JTableNested/orderUp|orderUp]]
+
|Moves a node one position to the left in the same level.
+
|-
+
|[[JTableNested/publish|publish]]
+
|Set the publishing state for a node or list of nodes in the table.
+
|-
+
|[[JTableNested/rebuildPath|rebuildPath]]
+
|Rebuilds a node's path field from the alias values of the node from the current node to the root node of the tree.
+
|-
+
|[[JTableNested/setLocation|setLocation]]
+
|Set the location of a node in the tree object.
+
|-
+
|[[JTableNested/store|store]]
+
|Stores a node in the database table.
+
|-
+
|}
+
===Importing===
+
<source lang="php">jimport( 'joomla.database.tablenested' );</source>
+
 
+
===See also===
+
<noinclude>[[Category:Development]][[Category:Framework]][[Category:JTableNested]]</noinclude>
+

Revision as of 14:50, 19 April 2011

This class is available in the following Joomla versions:-

Page "JTableNested" has no subpages to list.
Personal tools
Namespaces

Variants
Actions
Navigation
Joomla! Sites
Toolbox