News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Chris Hartjes' Blog:
Sorting Relationship Results In Doctrine 1.2
February 05, 2010 @ 10:51:32

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.

0 comments voice your opinion now!
relationship doctrine sort tutorial orderby


blog comments powered by Disqus

Similar Posts

Robert Basic's Blog: Creating a chat bot with PHP and Dbus

ThinkPHP Blog: Creating press-ready PDF documents on the fly including individual barcodes

Michael Maclean's Blog: Using Pango for PHP: a taster

Zend Developer Zone: Zend_Acl / Zend_Auth example scenario

Shameer's Blog: An Introduction to Smarty 3


Community Events

Don't see your event here?
Let us know!


list laravel example php7 language application symfony api introduction yii2 series opinion framework project programming interview part2 community podcast composer

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework