-
-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Results are not sorted with query builder #777
Comments
the sort order is only used when accessing nodes / documents in tree navigation. for queries, there is no defined sort order unless you use a order by. (but afaik there is no order by child-order). the preferred mode of interacting with phpcr is by using the tree structures. doing a query like in your example is porting the SQL patterns to phpcr. in a relational database, this is how you have to do it. but with phpcr, you can have a document Category and then do something like: $category = $dm->find('/cms/simple/products/fauteuil-de-bureau');
foreach ($category->getProducts() as $product) {... getProducts can use the |
I see, but is there a way to get the sort_order value in the results? |
the order is only meaningful within the children of a specific node. query are usually on whole ranges and not children of a single parent. if i have a tree like this
and my query finds B and F, the "sort order" has no meaning. sort order is relevant for B, C and for D, E and for F, G but as soon as you leave the context of a single parent, the sort order does not mean anything. |
I understand, thank you for your help. |
I make a query with the query builder.
The MySQL query executed is this one
Which leads to this results :
But the results returned by the query builder are not sorted by the
sort_order
field.The text was updated successfully, but these errors were encountered: