title: sort Magento collection AFTER load
body: <p>The Magento collection sorting functions (e.g. <code>Mage_Eav_Model_Entity_Collection_Abstract::addAttributeToSort</code>) work by adding an <code>ORDER BY</code> clause to the SQL select statement.  However, there are times when a collection has already been loaded and it is necessary to sort the collection.  </p>
  
  <p>It is certainly possible to use the <code>toArray($fields)</code> function and then PHP array sorting functions (either native or user-defined), however this is a little clumsy.  It also means that the objects in the collection are converted to "dumb" rows of values without magic getters/setters which can/are be implemented with algorithms, etc.</p>
  
  <p>I'm wondering if there are more elegant/Magento-esque methods of sorting the collection. </p>
  
  <p>Thanks,<br>
  Jonathan </p>