How to get foreign repository inside my repository in Doctrine2/Symfony2?

后端 未结 2 1780
攒了一身酷
攒了一身酷 2021-02-12 08:57

I need values from 2 different entities. I don\'t know how to do. I tried this so far:



        
2条回答
  •  抹茶落季
    2021-02-12 09:44

    You can access the EntityManager by calling Doctrine\ORM\EntityRepository#getEntityManager():

    $repository = $this
        ->getEntityManager()
        ->getRepository('PondGeolocBundle:User_Lake');
    

提交回复
热议问题