Doctrine_Core::getTable()->findAll() how to specify order?

Jake Wilson picture Jake Wilson · Aug 19, 2011 · Viewed 29.9k times · Source

When using a Doctrine_Table object, is it possible to specify the order of the returned collection when using findAll() or findByWhatever()?

In the doc's I see some stuff about getOrderByStatement() and processOrderBy() but it isn't clear on how to use them...

Answer

Aaron picture Aaron · Mar 25, 2013

You can also leave the first array blank

  $em->getRepository('BackendDestinyBundle:Destiny')->findBy(array(), array('title'=>'asc'));