Development Blog With Code Updates : Developercast.com

February 5, 2010

Chris Hartjes’ Blog: Sorting Relationship Results In Doctrine 1.2

Filed under: Development — @ 11:51 am

Doctrine allows you to set up relationships to link data in various tables together. Unfortunately, those aren’t always in the order they need to be in. In a new post to his blog Chris Hartjes shows you how to sort these relationship results just by adding a simple line to your request.

I started digging around via search engine. Took me about an hour to find the solution. First, it took me half the time to dive deep enough to find out WHERE I can define the default sort order. Surprisingly, it was in an area that made total sense but I could not find before.

You can see an example of it in the “hasMany” call in his code snippet – the addition of the “orderBy” option and the value showing the sorting order. Here’s the StackOverflow page that gave him the answer he needed.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress