开发者

Any hierarchical Data Support in Doctrine 2?

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?


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜