Public Member Functions | |
getLeftRight (&$wiki, $id, $oid=0) | |
return left and right value of hierarchy table | |
getNodeHierarchyById (&$wiki, $id) | |
returns a triplet (parent, left, right) from a master node id | |
getRootNodeHierarchy (&$wiki) | |
returns a triplet (parent, left, right) from root node | |
moveNode (&$wiki, $node_id, $old_parent_node_id, $left, $right, $parent_node_id) | |
move a node | |
insertNode (&$wiki, $id, $parent_node_id) | |
insert a node | |
deleteNode (&$wiki, $id, $left, $right, $parent_content_fk) | |
delete a node | |
removeNode (&$wiki, $id, $left, $right, $new_parent) | |
remove a node | |
setNewRootNode (&$wiki, $id, $root_right) | |
set a new root node |
NestedSetModelHelper::deleteNode | ( | &$ | wiki, | |
$ | id, | |||
$ | left, | |||
$ | right, | |||
$ | parent_content_fk | |||
) |
delete a node
The difference with removeNode is that removeNode modifies parent relationship so that removedNode has no parent and no children, but the 'entry' is not removed deleteNode also removes the entry
wiki | the controller so that we have access to configuration/parameters | |
id | id of node to delete | |
left | left_n value of node to delete | |
right | right_n value of node to delete | |
$parent_content_fk | parent of node being deleted that will be the new parent for the children of deleted node |
NestedSetModelHelper::getLeftRight | ( | &$ | wiki, | |
$ | id, | |||
$ | oid = 0 | |||
) |
return left and right value of hierarchy table
private method used in this class. the left and right value are the nested set model left and right values
wiki | the controller so that we have access to configuration/parameters | |
id | the id we want to retrieve left and right value from | |
oid | optional id we want to retrieve left and right value from |
NestedSetModelHelper::getNodeHierarchyById | ( | &$ | wiki, | |
$ | id | |||
) |
returns a triplet (parent, left, right) from a master node id
wiki | the controller so that we have access to configuration/parameters | |
id | database id of a master node |
NestedSetModelHelper::getRootNodeHierarchy | ( | &$ | wiki | ) |
returns a triplet (parent, left, right) from root node
wiki | the controller so that we have access to configuration/parameters |
NestedSetModelHelper::insertNode | ( | &$ | wiki, | |
$ | id, | |||
$ | parent_node_id | |||
) |
insert a node
wiki | the controller so that we have access to configuration/parameters | |
id | id of newly inserted node | |
parent_node_id | parent node of newly inserted page |
NestedSetModelHelper::moveNode | ( | &$ | wiki, | |
$ | node_id, | |||
$ | old_parent_node_id, | |||
$ | left, | |||
$ | right, | |||
$ | parent_node_id | |||
) |
move a node
wiki | the controller so that we have access to configuration/parameters | |
node_id | the id we want to move | |
old_parent_node_id | current parent node of this page | |
left | left value of node | |
right | right value of node | |
parent_node_id | new parent node of this page |
NestedSetModelHelper::removeNode | ( | &$ | wiki, | |
$ | id, | |||
$ | left, | |||
$ | right, | |||
$ | new_parent | |||
) |
remove a node
wiki | the controller so that we have access to configuration/parameters | |
id | id of node to remove | |
left | left_n value of node to remove | |
right | right_n value of node to remove | |
new_parent | parent of node being removed that will be the new parent for the children of removed node |
NestedSetModelHelper::setNewRootNode | ( | &$ | wiki, | |
$ | id, | |||
$ | root_right | |||
) |
set a new root node
wiki | the controller so that we have access to configuration/parameters | |
id | id of the new root node | |
root_right | right value of previous root node |