教条2中的任何分层数据支持? [英] Any hierarchical Data Support in Doctrine 2?
问题描述
更新1
好,所以我使用 Doctrine 2的嵌套集扩展。我有一些问题
1。在文档
$ child1 = new Category()中插入节点
//
$ child1-> name ='Child Category 1';
$ child2 = new Category();
$ child2-> name ='Child Category 2';
$ category-> addChild($ child1);
$ category-> addChild($ child2);
似乎我必须做一些像
$ root = $ nsm-> createRoot($ category);
$ root-> addChild($ child1);
$ root-> addChild($ child2);
同样添加子子
$ child2wrapper = $ root-> addChild($ child2);
$ child2wrapper-> addChild($ newChild);
2。说,我想要多个树,我看到扩展名没有填充我的根目录下的根目录,并拥有多个树。
< 字段?
你可以看到这个链接:
http://github.com/guilhermeblanco/Doctrine2-Hierarchical-Structural-Behavior
http://www.devcomments.com/Any-hierarchical-data-support-in-Doctrine-2-at251409.htm
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
这篇关于教条2中的任何分层数据支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!