#1670: Improve documentation for working with NestedSets with multiple roots.
----------------------------------------------+-----------------------------
Reporter: dao | Owner: jwage
Type: defect | Status: new
Priority: minor | Milestone:
Documentation/Website
Component: Documentation | Version: 1.0.3
Keywords: NestedSet, hasManyRoots, example | Has_test: 0
Mystatus: Pending Core Response | Has_patch: 1
----------------------------------------------+-----------------------------
The documentation is not clear on working with NestedSets with multiple
roots. The API docs should indicate the 'root_id' option for
NestedSet::fetchTree, and the Documentation should provide an example such
as the following:
{{{
$treeObject =
Doctrine::getTable('MyNestedSetTableHasManyRoots')->getTree();
$rootColumnName = $treeObject->getAttribute('rootColumnName');
foreach ($treeObject->fetchRoots() as $root) {
$options = array('root_id'=>$root->$rootColumnName);
foreach($treeObject->fetchTree($options) as $node) {
echo str_repeat(' ', $node['level']) . $node['name'] . "\n";
}
}
}}}
--
Ticket URL: <http://trac.phpdoctrine.org/ticket/1670>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"doctrine-svn" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---