NestedSetModelHelper Class Reference

helper to handle nested set model More...

List of all members.

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


Detailed Description

helper to handle nested set model


Member Function Documentation

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

Parameters:
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

Parameters:
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
Returns:
array[left, right] if oid == 0 or array[0..1][left, right] if oid != 0

NestedSetModelHelper::getNodeHierarchyById ( &$  wiki,
id 
)

returns a triplet (parent, left, right) from a master node id

Parameters:
wiki the controller so that we have access to configuration/parameters
id database id of a master node
Returns:
array[parent, left, right]

NestedSetModelHelper::getRootNodeHierarchy ( &$  wiki  ) 

returns a triplet (parent, left, right) from root node

Parameters:
wiki the controller so that we have access to configuration/parameters
Returns:
array[parent, left, right]

NestedSetModelHelper::insertNode ( &$  wiki,
id,
parent_node_id 
)

insert a node

Parameters:
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

Parameters:
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

Parameters:
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

Parameters:
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


The documentation for this class was generated from the following file:
Generated on Mon Feb 19 19:11:58 2007 for Wiclear by  doxygen 1.4.7