Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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

like image 956
Jake Wilson Avatar asked Aug 19 '11 16:08

Jake Wilson


1 Answers

You can also leave the first array blank

  $em->getRepository('BackendDestinyBundle:Destiny')->findBy(array(), array('title'=>'asc')); 
like image 130
Aaron Avatar answered Nov 13 '22 10:11

Aaron