[DC-909] Add Some Info to Doctrine Query order by Method Documentation Created: 01/Nov/10  Updated: 01/Nov/10

Status: Open
Project: Doctrine 1
Component/s: Documentation
Affects Version/s: 1.2.3
Fix Version/s: None

Type: Improvement Priority: Trivial
Reporter: Isaac Foster Assignee: Jonathan H. Wage
Resolution: Unresolved Votes: 0
Labels: None
Environment:

n/a



 Description   

This is very minor, but would have saved me a few minutes. On the Doctrine Query documentation page (V1 - http://www.doctrine-project.org/projects/orm/1.2/docs/manual/dql-doctrine-query-language/en#order-by-clause), it would be useful to note that multiple calls to Doctrine_Query::orderBy() do not stack, and that the later calls will over write the previous ones. I'll propose:

To sort by multiple columns, you must specify them in one call to Doctrine_Query::orderBy(). If you call orderBy a second time, the column from the first call will not be included in the resulting query.

<code>
//works as expected
//results in ORDER BY id ASC, userName DESC
$query->orderBy('id ASC, userName DESC');

//does not work as expected
//results in ORDER BY userName DESC
$query->orderBy('id ASC')
->orderBy('userName DESC');
</code>


Generated at Thu Jul 31 09:35:56 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.