Yeah I read the docu multiple-times :-)
If doctrine would "handle the information internally" then I would
like to know, why one would expect a correct ordering, but get it
messed-up in the following simple example:

Same schema and fixtures as above. The Doctrine-documentation gives an
example usage, to render a simple tree (many-roots=false):

$treeObject = Doctrine::getTable('Category')->getTree();
$tree = $treeObject->fetchTree();

foreach ($tree as $node) {
    echo str_repeat('  ', $node['level']) . $node['name'] .
"\n";
}

The order is messed-up as described above. why? Well one could say
that the fixture file has many roots and it does not fit the
schema.yml, but if that's the reason, I would like to know, WHY it's
NOT handled correctly and what the advantages of none-unique ltr-
values are?! And of course I would then like to know what the proper
way would be to fix the example.
I thought NestedSets are supposed to have a asc ltr with UNIQUE
values.


Good night :-)

On 18 Apr., 19:10, Alexandru-Emil Lupu <[email protected]> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> is not a bug.
> Internally, Doctrine will arange the information. However what you
> should look at is to check lft value. You will see that lft is
> ascending. I would recomend you to have a look on Documentation.
> Alecs
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Use GnuPG with Firefox :http://getfiregpg.org(Version: 0.7.10)
>
> iEYEARECAAYFAkvLPREACgkQIdlZQSANiuZ8VwCgoer2yDiGV2OyZ48kW7T7q9yp
> imwAni6rV2ix4PyrIVo/ge/az9b5rQZn
> =LNgJ
> -----END PGP SIGNATURE-----
>
>
>
> On Sun, Apr 18, 2010 at 7:08 PM, comb <[email protected]> wrote:
> > schema.yml:
> > Category
> >  actAs: [NestedSet]
> > ...
>
> > fixtures.yml:
> > Category:
> >  NestedSet: true
> >  c0:
> >    name: cat0
> >  c1:
> >    name: cat1
> >    children:
> >      c2:
> >        name: cat2
> >  c3:
> >    name: cat3
> >    children:
> >      c4:
> >        name: cat4
>
> > A query "SELECT * FROM .. ORDER BY lft asc" results in an incorrect
> > ordering c0,c1,c3,c2,c4.
>
> > It should be c0,c1,c2,c3,c4
>
> > The problem is, that c0, c1 and c3 get 1 as lft-value which is
> > incorrect:http://en.wikipedia.org/wiki/Nested_set_model
>
> > You can workaround with hasManyRoots = true and .. ORDER BY root_id
> > asc, lft asc
> > But doctrine shouldn't assign a value multiple times to lft since it's
> > not a nestedSet anymore?!
>
> > Or what's up here?
>
> > --
> > 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 [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]
> > For more options, visit this group at
> >http://groups.google.com/group/symfony-users?hl=en
>
> --
> Have a nice day!
>
> Alecs
> Certified ScrumMaster
>
> There are no cannibals alive! I have ate the last one yesterday ...
> I am on web:  http://www.alecslupu.ro/
> I am on twitter:http://twitter.com/alecslupu
> I am on linkedIn:http://www.linkedin.com/in/alecslupu
> Tel: (+4)0722 621 280
>
> --
> 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 [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group 
> athttp://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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to