JTableNested

Aus Joomla! Dokumentation
Wechseln zu: Navigation, Suche

Inhaltsverzeichnis

[Bearbeiten] Beschreibung

class JTableNested extends JTable

ToDo Übersetzen

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. From Joomla 1.6 onwards.

[Bearbeiten] Definiert in

Folder blue.png /libraries/joomla/database/tablenested.php

[Bearbeiten] Status

  • @since Joomla 11.1

[Bearbeiten] Importieren

[Bearbeiten] Erweitert

JTable

[Bearbeiten] Wird erweitert von

JTableAsset, JTableCategory, JTableMenu.

[Bearbeiten] Eigenschaften

Access Typ Name Beschreibung
public integer $parent_id Object property holding the primary key of the parent node. Provides adjacency list data for nodes. ToDo übersetzen
public integer $level Object property holding the depth level of the node in the tree. ToDo übersetzen
public integer $lft Object property holding the left value of the node for managing its placement in the nested sets tree. ToDo übersetzen
public integer $rgt Object property holding the right value of the node for managing its placement in the nested sets tree. ToDo übersetzen
public string $alias Object property holding the alias of this node used to constuct the full text path, forward-slash delimited. ToDo übersetzen
protected string $_location Object property to hold the location type to use when storing the row. ToDo übersetzen
protected integer $_location_id Object property to hold the primary key of the location reference node to use when storing the row. A combination of location type and reference node describes where to store the current node in the tree. ToDo übersetzen
protected array $_cache An array to cache values in recursive processes. ToDo übersetzen
protected integer $_debug Debug level ToDo übersetzen

[Bearbeiten] Methoden

Access Name
protected _getNode($id, [$key = null])

Method to get nested set properties for a node in the tree.ToDo Beschreibung übersetzen

protected _getTreeRepositionData($referenceNode, $nodeWidth, [$position = 'before'])

Method to get various data necessary to make room in the tree at a location for a node and its children. The returned data object includes conditions for SQL WHERE clauses for updating left and right id values to make room for the node as well as the new left and right ids for the node.ToDo Beschreibung übersetzen

protected _logtable([$showData = true], [$showQuery = true])

Method to create a log table in the buffer optionally showing the query and/or data.ToDo Beschreibung übersetzen

protected _runQuery($query, $errorMessage)

Method to run an update query and check for a database errorToDo Beschreibung übersetzen

public check()

Asset that the nested set data is valid.ToDo Beschreibung übersetzen

public debug($level)

Sets the debug level on or offToDo Beschreibung übersetzen

public delete([$pk = null], [$children = true])

Method to delete a node and, optionally, its child nodes from the table.ToDo Beschreibung übersetzen

public getPath([$pk = null], [$diagnostic = false])

Method to get an array of nodes from a given node to its root.ToDo Beschreibung übersetzen

public getRootId()

Gets the ID of the root item in the treeToDo Beschreibung übersetzen

public getTree([$pk = null], [$diagnostic = false])

Method to get a node and all its child nodes.ToDo Beschreibung übersetzen

public isLeaf([$pk = null])

Method to determine if a node is a leaf node in the tree (has no children).ToDo Beschreibung übersetzen

public move($delta, [$where = ' '])

Method to move a row in the ordering sequence of a group of rows defined by an SQL WHERE clause.ToDo Beschreibung übersetzen

public moveByReference($referenceId, [$position = 'after'], [$pk = null])

Method to move a node and its children to a new location in the tree.ToDo Beschreibung übersetzen

public orderDown($pk)

Method to move a node one position to the right in the same level.ToDo Beschreibung übersetzen

public orderUp($pk)

Method to move a node one position to the left in the same level.ToDo Beschreibung übersetzen

public publish([$pks = null], [$state = 1], [$userId = 0])

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 not 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.ToDo Beschreibung übersetzen

public rebuild([$parentId = null], [$leftId = 0], [$level = 0], [$path = ' '])

Method to recursively rebuild the whole nested set tree.ToDo Beschreibung übersetzen

public rebuildPath([$pk = null])

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.ToDo Beschreibung übersetzen

public saveorder([$idArray = null], [$lft_array = null])

Method to update order of table rowsToDo Beschreibung übersetzen

public setLocation($referenceId, [$position = 'after'])

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.ToDo Beschreibung übersetzen

public store([$updateNulls = false])

Method to store a node in the database table.ToDo Beschreibung übersetzen

[Bearbeiten] Siehe auch

Meine Werkzeuge
Namensräume
Varianten
Aktionen
Navigation
Sonstiges
Team Navigation
Werkzeuge