Re: DB_Nested 1.3 createRootNode problem

From: Date: Mon, 27 Oct 2003 10:19:00 +0000
Subject: Re: DB_Nested 1.3 createRootNode problem
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-23023@lists.php.net to get a copy of this message
Arnaud Limbourg wrote:
the createRootNode method fails with 1.3 of DB_NestedSet. function prototype is as follows function createRootNode($values, $id = false, $first = false, $_pos = 'AF') { $id and $first are optional. If a call to createRootNode is made as such $nestedSet->createRootNode($values); The creation fails because both $id and $first are false the test is always true. test is done as follows
createRootNode() needs either $values and $id or $values and $first. Reason: $first is only a flag to indicate that you really know what you are doing. If $first is set, a new tree is built which means that the old get's _deleted_. The method doesn't look that nice atm - but I have to keep it for BC reasons. Normally you only need createRootNode() to create the first node of the tree. All other rootnodes can be created by calling createRightNode()/createLeftNode() on a rootnode. greetings Daniel Khan

« previous php.pear.dev (#23023) next »