->orderBy() – Add an order by condition


void $DB_DataObject->orderBy ( string $order )


Adds a order by condition. Calling this without any arguments clears the current order condition.


  • string $order - Order


This function can not be called statically.

The quote_identifiers configuration option will not affect data sent to orderBy.


Setting the order by

= new DataObjects_Person;
$person->orderBy('age, eye');

// or with direction:
$person = new DataObjects_Person;
$person->orderBy('name ASC');
$person->orderBy('age DESC, eye');


Resulting SQL

SELECT * FROM person ORDER BY name, age, eye
Set limit (Previous) Add group by condition (Next)
Last updated: Thu, 26 Nov 2015 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report or add a note.
View this page in:

User Notes:

There are no user contributed notes for this page.