tags:

views:

20

answers:

1

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  A: 

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

Haim Evgi
ok i used the extension from the link and have afew further questions. see my update (1)
jiewmeng
sorry but i never use it, i hope others user help :)
Haim Evgi
Were you able to solve the problem ?
Haim Evgi
i found my answers to update @ [Google Groups - Doctrine Users](http://groups.google.com/group/doctrine-user/msg/7fbc1e620016cd2d)
jiewmeng