I'm getting error for "$qb = $this->getDoctrine()->getManager()->createQueryBuilder();" this line in my project file . Can someone help me enter image description here
Asked
Active
Viewed 116 times
1 Answers
0
I think that $qb = $this->getDoctrine()->getManager()
is getting an instance of Doctrine\Common\Persistence\ObjectManager
, which doesn't have createQueryBuilder
function.
From the manager, you can fetch repository for the entity you want to fetch. For example:
$qb = $this->getDoctrine()->getManager()->getRepository('App:MyClass')->createQueryBuidler()

Nenad Mitic
- 577
- 4
- 12