I've had the same issue recently and decided NOT to go with nested set.
Nested set is a great tool if you really have hierarchical data that should
be represented by a tree of unknown depth and need to input new data
anywhere in the tree.

In my case, and it seems true in your case too, I was sure not to go over 2
levels. My elements are either parents or children, but you cannot be
children category of a parent one, and at the same time still have children
categories.
In that case with only 2 levels, I found faster and more easy to have
something like:

Category:
   columns:
       name:         text
       parent_id:    integer
   relations:
       Parent:
          class:        Category
          local:         parent_id
          foreign:      id
          foreignAlias: Children

If you know your structure and data will not (or very rarely) change and if
you do not need a big depth, I find this solution way more convenient than
using the nested set.

Those are my 2cents on this topic ;-) use them if you will!

On Mon, Sep 6, 2010 at 2:33 PM, Christopher Schnell <
christopher.schn...@mda.ch> wrote:

>  That’s right, Nested Set is the way to go.
>
>
>
> Both Propel and Doctrine support them.
>
>
>
> Regards,
>
> Christopher.
>
>
>
> *Von:* symfony-users@googlegroups.com [mailto:
> symfony-us...@googlegroups.com] *Im Auftrag von *Arnold Ispan
> *Gesendet:* Sonntag, 5. September 2010 21:31
> *An:* symfony-users@googlegroups.com
> *Betreff:* Re: [symfony-users] [symfony1.4] not sure how to make
> parent-child category structure in doctrine schema
>
>
>
> Hello,
>
>
>
> Why don't use nested sets to represent this structure?
>
>
>
> On Sun, Sep 5, 2010 at 9:39 PM, ryr <ryr1...@gmail.com> wrote:
>
> Hello,
>
> I want to make a two-tier structure of the categories in which each
> item is either a parent of, or relate to one of the parents.
>
> Example structure:
> Category 1
> - Subcategory 1
> - Subcategory 2
> - Subcategory 3
> Category 2
> Category 3
> - Subcategory 4
> - Subcategory 5
> Category 4
>
> How to implement this in config/doctrine/schema.yml?
>
> --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to symfony-users@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com<symfony-users%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>
>
>
> --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to symfony-users@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com<symfony-users%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>
> --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to symfony-users@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com<symfony-users%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to