I am using the findBy()
method on a Doctrine repository:
$entities = $repository->findBy(array('type'=> 'C12'));
How can I order the results?
This question is related to
php
doctrine-orm
$ens = $em->getRepository('AcmeBinBundle:Marks')
->findBy(
array(),
array('id' => 'ASC')
);
$cRepo = $em->getRepository('KaleLocationBundle:Country');
// Leave the first array blank
$countries = $cRepo->findBy(array(), array('name'=>'asc'));
Source: Stackoverflow.com