For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > March 2005 > Tree









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Tree
Rob Barreca

2005-03-19, 3:57 am

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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com