DB_NestedSet::createSubNode()
-- Creates a subnode
Description
+-- root1
|
+-\ root2 [target]
| |
| |-- subnode1 [new]
|
+-- root3
Parameter
- integer
$id
Parent node ID
- array
$values
Hash with param => value pairs of the node (see $this->params)
Return value
returns
The node id or false on error
Throws
throws
no exceptions thrown
Note
This function can not be called
statically.
Example
Example 36-1. Create subnodes require_once('DB/NestedSet.php');
$nestedSet =& DB_NestedSet::factory('DB', $dsn, $params);
$parent = $nestedSet->createRootNode(array('name' => 'rootnode'), false, true);
$nestedSet->createSubNode($parent, array('name' => "node")); |
|