Class: Utility_NestedSet
Source Location: /utility_classes/nestedset.class.php
Class Details
[line 42]
Class Variables
Class Methods
constructor __construct [line 63]
Utility_NestedSet __construct(
)
|
|
Start instance of base class, load configuration and establish database connection. Please don't call the constructor direcly, use the singleton pattern instead.
Tags:
method changeNavigationOfNodeInTree [line 2962]
bool changeNavigationOfNodeInTree(
int
$navigation, int
$node_id, int
$new_navigation)
|
|
Takes node out of a navigation and puts it at the end of another navigation. Takes the id of the "old" navigation as first argument, the id of the root node to move as second argument and the id of the new navigation as third and last argument.
Tags:
Parameters:
method changeNavigationOfRootNode [line 2730]
bool changeNavigationOfRootNode(
int
$navigation, int
$node_id, int
$new_navigation)
|
|
Takes root node out of a navigation and puts it at the end of another navigation. Takes the id of the "old" navigation as first argument, the id of the root node to move as second argument and the id of the new navigation as third and last argument.
Tags:
Parameters:
method countNodes [line 3595]
int countNodes(
[array
$params = array()])
|
|
Method to count the nodes. Takes key=>value array with count params as first argument. Returns int. List of supported params: - navigation, int, optional: Navigation id
- root_node, int, optional: Root node id
- parent, int, optional: Parent node id
Tags:
Parameters:
method createNode [line 91]
int createNode(
int
$navigation, [int
$reference = null], [int
$position = null])
|
|
Wrapper around all the other create* functions. Decides which of all the different create* functions to use.
Tags:
Parameters:
method createNodeAbove [line 331]
int createNodeAbove(
int
$navigation, int
$reference)
|
|
Creates node above existing node. Takes the navigation id as first argument, the id of the reference node above that the new node will be positioned as second argument. Returns insert id.
Tags:
Parameters:
method createNodeBelow [line 423]
int createNodeBelow(
int
$navigation, int
$reference)
|
|
Creates node below existing node (~ creates new branch). Takes the navigation id as first argument, the id of the reference node where the sub node will be attached to as second argument. Returns insert id.
Tags:
Parameters:
method createRootNode [line 204]
int createRootNode(
int
$navigation, [int
$reference = null], [int
$position = null])
|
|
Creates new root node. Takes the navigation id as first argument, the id of the reference node after or before the new node will be created as second argument and the positioning information as third argument. Returns insert id of the new node. Supported constants for parameter position: - UTILITY_NESTEDSET_CREATE_BEFORE: node will be created before
reference node
- UTILITY_NESTEDSET_CREATE_AFTER: node will be created after
reference node
Tags:
Parameters:
method deleteNode [line 132]
int deleteNode(
int
$navigation, int
$node)
|
|
Wrapper around the different delete* functions. Decides which of all the different delete functions to use.
Tags:
Parameters:
method deleteNodeInTree [line 3317]
int deleteNodeInTree(
int
$navigation, int
$node_id)
|
|
Removes node. Takes the navigation id as first argument, the id of the node to delete as second argument. Returns amount of affected rows.
Tags:
Parameters:
method deleteRootNode [line 3096]
int deleteRootNode(
int
$navigation, int
$node_id)
|
|
Removes root node. Takes the navigation id as first argument, the id of the root node to delete as second argument. Returns amount of affected rows.
Tags:
Parameters:
method moveDownAcrossTrees [line 2081]
bool moveDownAcrossTrees(
int
$navigation, int
$node_id)
|
|
Moves node down across a tree. Takes the navigation id as first argument, the id of the node to move as second argument. Returns boolean true.
Tags:
Parameters:
method moveDownInTree [line 2315]
bool moveDownInTree(
int
$navigation, int
$node_id)
|
|
Moves node down in tree. Takes the navigation id as first argument, the id of the node to move as second argument. Returns boolean true.
Tags:
Parameters:
method moveNode [line 160]
bool moveNode(
int
$navigation, int
$node, [string
$direction = "down"])
|
|
Wrapper around the different move* functions. Deciedes which of all the different move functions to use.
Tags:
Parameters:
method moveUpAcrossTrees [line 510]
bool moveUpAcrossTrees(
int
$navigation, int
$node_id)
|
|
Moves node up across two trees. Takes the navigation id as first argument, the id of the node to move as second argument. Returns boolean true. Attention: Is only able to move nodes with a lft between 1 and 2.
Tags:
Parameters:
method moveUpInTree [line 1620]
bool moveUpInTree(
int
$navigation, int
$node_id)
|
|
Moves node up in tree. Takes the navigation id as first argument, the id of the node to move as second argument. Returns boolean true. Attention: Cannot move nodes with lft < 2.
Tags:
Parameters:
method node_exists [line 4040]
bool node_exists(
int
$node, [int
$navigation = null])
|
|
Checks whether a node exists or not. Takes the node id as first argument and the navigation id as optional second argument. Returns bool.
Tags:
Parameters:
method root_node [line 4090]
bool root_node(
int
$node, [int
$navigation = null])
|
|
Tests whether a node is a root node or not. Takes the node id as first argument and the navigation id as optional second argument. Returns bool.
Tags:
Parameters:
method selectMaxSorting [line 3963]
int selectMaxSorting(
int
$navigation)
|
|
Returns highest value in the sorting column for the given navigation. Takes the navigation id as first argument. Returns int.
Tags:
Parameters:
method selectMinSorting [line 4001]
int selectMinSorting(
int
$navigation)
|
|
Returns smallest value in the sorting column for the given navigation. Takes the navigation id as first argument. Returns int.
Tags:
Parameters:
method selectNode [line 3452]
array selectNode(
int
$id)
|
|
Selects node. Takes the node id as first argument. Returns array.
Tags:
Parameters:
method selectNodes [line 3505]
array selectNodes(
[array
$params = array()])
|
|
Method to select one or more nodes. Takes key=>value array with select params as first argument. Returns array. List of supported params: - navigation, int, optional: Navigation id
- root_node, int, optional: Root node id
- parent, int, optional: Parent node id
- start, int, optional: row offset
- limit, int, optional: amount of rows to return
Tags:
Parameters:
method selectSiblingAbove [line 3669]
array selectSiblingAbove(
int
$navigation, int
$reference)
|
|
Selects node above reference node. Takes the navigation id as first argument, the id of the reference node as second argument. Returns array with complete information about sibling.
Tags:
Parameters:
method selectSiblingAboveOneLevelDeeper [line 3744]
array selectSiblingAboveOneLevelDeeper(
int
$navigation, int
$reference)
|
|
Selects sibling above the reference node that's one level deeper than the current node. Takes the navigation id as first argument, the reference node id as second argument. Returns array with full node information.
Tags:
Parameters:
method selectSiblingAboveOneLevelHigher [line 3817]
array selectSiblingAboveOneLevelHigher(
int
$navigation, int
$reference)
|
|
Selects sibling above the reference node that's one level higher than the current node. Takes the navigation id as first argument, the id of the reference node as second argument. Returns array with full node information.
Tags:
Parameters:
method selectSiblingBelow [line 3891]
array selectSiblingBelow(
int
$navigation, int
$reference)
|
|
Select sibling below reference node. Takes the navigation id as first argument and the id of the reference node as second argument. Returns array with full node information.
Tags:
Parameters:
method testConsistency [line 4122]
bool testConsistency(
int
$navigation)
|
|
Executes consistency check on a a navigationt tree. Takes the navigation id as first argument. Returns bool.
Tags:
Parameters:
method testForRootNodes [line 4204]
bool testForRootNodes(
array
$whole_tree)
|
|
Tests if there's at least one root node in the navigation tree. Takes an array with all nodes of a navigation (as returned by selectNodes()) as first argument. Returns bool.
Tags:
Parameters:
method testNestedSets [line 4234]
bool testNestedSets(
array
$whole_tree)
|
|
Tests if the nested set structure is valid. Takes an array with all nodes of a navigation (as returned by selectNodes()) as first argument. Returns bool.
Tags:
Parameters:
method testSanity [line 4158]
bool testSanity(
array
$whole_tree)
|
|
Tests if all the numbers and identifiers in the navigation tree seem to make sense. Takes an array with all nodes of a navigation (as returned by selectNodes()) as first argument. Returns bool.
Tags:
Parameters:
|
|