Query builder for query on documents - order by children order, as when using getChildren()
26 views
Skip to first unread message
Joschi 127
unread,
Oct 24, 2016, 12:18:19 PM10/24/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to symfony-...@googlegroups.com
Hi all,
we are using query builder to query for documents and joining with another type of document, and setting several conditions. Works fine. (In dead running fine since about 2 years now already and even with a lot of documents.)
However now we want to order the documents by their defined order - the same order as when using getChildren() of the parent document.
How can this be done when using the query builder?
All matching documents have the same parent.
Thanks a lot
Joschi
Daniel Leech
unread,
Oct 24, 2016, 1:50:36 PM10/24/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to symfony-...@googlegroups.com
We had the same problem when I was working on Sulu CMS. AFAIRC it is an
implementation detail, there is apparently a switch in Jackrabbit to
enable "natural ordering", we could not, however, get this to work.
Our solution was to add a subscriber which set an integer value on the
document, and then order on that field:
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to symfony-...@googlegroups.com
Okay - thanks for your response. We also thought about just using an additional integer value but we were wondering if there isn't a way to do this using the query builder.
But I think we can live with an integer value at least for now.
Thanks
Joschi
Joschi 127
unread,
Oct 24, 2016, 4:13:27 PM10/24/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to symfony-...@googlegroups.com
PS: Your way of doing this in a subscriber is nice of course. Thanks for the direct link to the code.