previousDB_NestedSet::createRootNode (Previous) (Next) DB_NestedSet::deleteNodenext

View this page in Last updated: Sun, 18 Oct 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

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"));
?>
previousDB_NestedSet::createRootNode (Previous) (Next) DB_NestedSet::deleteNodenext

Download Documentation Last updated: Sun, 18 Oct 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.