find and findby

"find" works only for a single id. If you want to query for a set of id's you can use "findBy"


$em = $this->getDoctrine()->getEntityManager();
$em->getRepository('AcmeUserBundle:User').find($id);
$em->getRepository('AcmeBannieresBundle:BannerCity')->findBy(array('id' =>$banners));

评论

热门博文