Any hierarchical Data Support in Doctrine 2?

∥☆過路亽.° 提交于 2019-12-11 08:47:40

问题


in Doctrine 1, i see that it supports hierarchical data support? is there any in Doctrine 2?

UPDATE 1

ok so i used Nested Set Extension for Doctrine 2. i have some questions

1. inserting a node

// in the docs
$child1 = new Category();
$child1->name = 'Child Category 1';

$child2 = new Category();
$child2->name = 'Child Category 2';

$category->addChild($child1);
$category->addChild($child2);

it seems like i must do something like

$root = $nsm->createRoot($category);
$root->addChild($child1);
$root->addChild($child2);

likewise to add sub children

$child2wrapper = $root->addChild($child2);
$child2wrapper->addChild($newChild);

2. abt the root field and having multiple trees.

say i want multiple trees, i see that the extension does not populate my root field? how shld i populate it?


回答1:


you can see this links :

http://github.com/guilhermeblanco/Doctrine2-Hierarchical-Structural-Behavior

http://www.devcomments.com/Any-hierarchical-data-support-in-Doctrine-2-at251409.htm



来源:https://stackoverflow.com/questions/3350157/any-hierarchical-data-support-in-doctrine-2

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!