DB_NestedSet::createRootNode()
DB_NestedSet::createRootNode()
--
Creates a new root node. If no id is specified then it is either added to
the beginning/end of the tree based on the $pos.
Description
Optionally it deletes the whole tree and creates one initial rootnode
+-- root1 [target]
|
+-- root2 [new]
|
+-- root3
Parameter
- array $values
Hash with param => value pairs of the node (see $this->params)
- integer $id
ID of target node (the rootnode after which the node should be inserted)
- boolean $first
Danger: Deletes and (re)inits the whole tree - sequences are reset
- string $pos
The position in which to insert the new node.
Example
Example 39-1. Create rootnodes
|
