Search code examples
phpsymfony1doctrine

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


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...


Solution

  • You can also leave the first array blank

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