How to order results with findBy() in Doctrine

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

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

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

How can

3条回答
  •  萌比男神i
    2021-01-30 08:24

    The second parameter of findBy is for ORDER.

    $ens = $em->getRepository('AcmeBinBundle:Marks')
              ->findBy(
                 array('type'=> 'C12'), 
                 array('id' => 'ASC')
               );
    

提交回复
热议问题