DB_NestedSet::createSubNode

DB_NestedSet::createSubNode() – Creates a subnode

Synopsis

require_once 'DB/NestedSet.php';

mixed DB_NestedSet::createSubNode ( integer $id , array $values )

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

Create subnodes

<?php
require_once('DB/NestedSet.php');
    
$nestedSet =& DB_NestedSet::factory('DB'$dsn$params);
    
$parent $nestedSet->createRootNode(array('name' => 'rootnode'), falsetrue);
    
$nestedSet->createSubNode($parent, array('name' => "node"));
?>
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. (Previous) Deletes a node (Next)
Last updated: Tue, 19 Aug 2014 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report or add a note.
View this page in:

User Notes:

There are no user contributed notes for this page.