magento Collections Sorting


Example

// sort by creation date
$orders->setOrder('created_at', 'asc');
$orders->setOrder('created_at', 'desc'); 
$orders->setOrder('created_at'); // default direction is 'desc'