Public Member Functions | |
| Tree ($table, $leftCol= 'left', $rightCol= 'right', $deepCol= 'deep', $treeCol= '') | |
| newRoot ($tree="", $values="") | |
| newFirstChild ($id, $values="") | |
| newLastChild ($id, $values="") | |
| newPrevBrother ($id, $values="") | |
| newNextBrother ($id, $values="") | |
| deleteNode ($id) | |
| _addNode ($node, $values="") | |
| _shiftPositions ($from, $delta, $tree) | |
| getPosition ($id) | |
| getChildren ($id, $direct=FALSE) | |
| countChildren ($id, $direct=FALSE) | |
| printTree ($id, $attributes="") | |
Data Fields | |
| $table | |
| $leftCol | |
| $rightCol | |
| $deepCol | |
| $treeCol | |
Definition at line 19 of file class.tree.php.
| _addNode | ( | $ | node, | |
| $ | values = "" | |||
| ) |
Definition at line 197 of file class.tree.php.
| _shiftPositions | ( | $ | from, | |
| $ | delta, | |||
| $ | tree | |||
| ) |
Definition at line 218 of file class.tree.php.
| countChildren | ( | $ | id, | |
| $ | direct = FALSE | |||
| ) |
Count number of children a node has. $direct param specifies if we count only direct children or direct children and all their children
| int | $id id of the node we want to count children | |
| boolean | $direct if true we only count direct children, if false we count all children |
Definition at line 306 of file class.tree.php.
| deleteNode | ( | $ | id | ) |
delete a node and all its children
| int | $id |
Definition at line 169 of file class.tree.php.
| getChildren | ( | $ | id, | |
| $ | direct = FALSE | |||
| ) |
Definition at line 278 of file class.tree.php.
| getPosition | ( | $ | id | ) |
Get the left, right and deep attributes of a node
| $id | id of the node |
Definition at line 246 of file class.tree.php.
| newFirstChild | ( | $ | id, | |
| $ | values = "" | |||
| ) |
create a node that will be the first child of node $id
| int | $id id of the parent node |
Definition at line 81 of file class.tree.php.
| newLastChild | ( | $ | id, | |
| $ | values = "" | |||
| ) |
create a node that will be the last child of node $id
| $id | id of the parent node |
Definition at line 103 of file class.tree.php.
| newNextBrother | ( | $ | id, | |
| $ | values = "" | |||
| ) |
create a node that will be the next brother of node $id
| $id | id of the brother node |
Definition at line 149 of file class.tree.php.
| newPrevBrother | ( | $ | id, | |
| $ | values = "" | |||
| ) |
create a node that will be the previous brother of node $id
| $id | id of the brother node |
Definition at line 126 of file class.tree.php.
| newRoot | ( | $ | tree = "", |
|
| $ | values = "" | |||
| ) |
create root node
Definition at line 61 of file class.tree.php.
| printTree | ( | $ | id, | |
| $ | attributes = "" | |||
| ) |
Display the tree that has '$id' as root
| $id | id of the root of the tree to display |
Definition at line 340 of file class.tree.php.
| Tree | ( | $ | table, | |
| $ | leftCol = 'left', |
|||
| $ | rightCol = 'right', |
|||
| $ | deepCol = 'deep', |
|||
| $ | treeCol = '' | |||
| ) |
constructor, build a tree object
| string | $table name of the sql table containing the tree nodes | |
| string | $leftCol name of the 'left' column in $table | |
| string | $rightCol name of the 'right' column in $table | |
| string | $deepCol name of the 'deep' column in $table |
Definition at line 44 of file class.tree.php.
| $deepCol |
Definition at line 28 of file class.tree.php.
| $leftCol |
Definition at line 24 of file class.tree.php.
| $rightCol |
Definition at line 26 of file class.tree.php.
| $table |
Definition at line 22 of file class.tree.php.
| $treeCol |
Definition at line 32 of file class.tree.php.
1.6.3