API16

Difference between revisions of "JTableNested"

From Joomla! Documentation

(New page: <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki> </span> {{Description:JTableNested}} ===Defined in...)
 
m (preparing for archive only)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<span class="editsection" style="font-size:76%;">
+
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.
<nowiki>[</nowiki>[[Description:JTableNested|Edit Descripton]]<nowiki>]</nowiki>
 
</span>
 
{{Description:JTableNested}}
 
  
 
===Defined in===
 
===Defined in===
Line 57: Line 54:
 
|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.
 
|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.
 
|}
 
|}
 +
 
===Importing===
 
===Importing===
 
<source lang="php">jimport( 'joomla.database.tablenested' );</source>
 
<source lang="php">jimport( 'joomla.database.tablenested' );</source>
  
<span class="editsection" style="font-size:76%;">
+
 
<nowiki>[</nowiki>[[SeeAlso:JTableNested|Edit See Also]]<nowiki>]</nowiki>
+
 
</span>
 
{{SeeAlso:JTableNested}}
 
  
 
===Examples===
 
===Examples===
<CodeExamplesForm />
+
=== Code Examples ===
 
<dpl>
 
<dpl>
 
  noresultsheader=\n
 
  noresultsheader=\n
 
  category=JTableNested
 
  category=JTableNested
  category=CodeExample
+
  namespace=CodeExample
 
  category=ClassExample
 
  category=ClassExample
 
  include=*
 
  include=*
 
  format= ,,,
 
  format= ,,,
 
</dpl>
 
</dpl>

Latest revision as of 21:11, 24 March 2017

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]

libraries/joomla/database/tablenested.php

Methods[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.

Importing[edit]

jimport( 'joomla.database.tablenested' );



Examples[edit]

Code Examples[edit]