How to order results with findBy() in Doctrine

前端 未结 3 607
野性不改
野性不改 2021-01-30 07:31

I am using the findBy() method on a Doctrine repository:

$entities = $repository->findBy(array(\'type\'=> \'C12\'));

How can

3条回答
  •  一生所求
    2021-01-30 08:15

    $cRepo = $em->getRepository('KaleLocationBundle:Country');
    
    // Leave the first array blank
    $countries = $cRepo->findBy(array(), array('name'=>'asc'));
    

提交回复
热议问题