Tree
| From: | Rob Barreca | Date: | Sat, 19 Mar 2005 02:05:19 +0000 |
| Subject: | Tree | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-18148@lists.php.net to get a copy of this message | ||
I've been trying to get Tree to work, but I need a little help and the docs have nothing for me.
Say, I have a table that just has rows with id, id_parent, and name. I've been using this code to load it in a Tree, but I'm not getting what I want. I don't have an actual node with id = 0.
$options = array(
'order' => 'short_name',
'table' => 'resource_keyword_cats',
'whereAddOn' => 'id_parent = 0',
'columnNameMaps' =>
array('parentId' => 'id_parent')
);
$tree = Tree::setup('Memory_DBnested', $dbDsn, $options);
$tree->setup();
$tree->varDump();
And I get the list of the top nodes, but none of their children.
--
Rob Roy Barreca
__________________________________________________
Electronic Insight ..... a web development company
Email .................. rob@electronicinsight.com
Website ................ www.electronicinsight.com