Tree removing nodes
| From: | Joseph Blythe | Date: | Tue, 20 May 2003 03:07:14 +0000 |
| Subject: | Tree removing nodes | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-5445@lists.php.net to get a copy of this message | ||
Hey all,
Is there a way to just remove one node at a time ? I don't mind if a node
and all it children get deleted but this really isnt the best situation when
its a root node (parentId = 0)
For example consider the situation below id's 1-5 are root nodes 6-8 are
children of id 1 if I remvoved id one 1 -5 are also removed ?
id Parent name
1 0 One
2 0 Two
3 0 Three
4 0 Four
5 0 Five
6 1 Six
7 1 Seven
8 1 Eight
--snip
$options = array(
'table' => 'categories',
'whereAddOn' => 'user_id=0');
$tree = Tree::setup('Dynamic_DBnested', $dsn, $options);
$node = $tree->remove($_GET['id']);
if (PEAR::isError($node)) {
echo "Error deleting node: " . $node->getUserInfo();
}
snip--
Anyone suggest a way to get out of this I tried the _remove() method nothing
happens ?
Any help appreciated,
Joseph Blythe