I have this query below:
SELECT *
FROM mydb.users
left join mydb.jobs
on users.user_id = jobs.job_id;
And I used to convert them in orm query just like below:
return
$qb = $this->entityManager->createQueryBuilder();
$qb->select('rb', 'l')
->from('Admin\Entity\Users', 'rb')
->leftJoin(
'Admin\Entity\Jobs',
'l',
\Doctrine\ORM\Query\Expr\Join::WITH,
'rb.user_id = l.job_id'
)
->getQuery()
->getResult(AbstractQuery::HYDRATE_ARRAY);
But it doesn's still work. I get the following error:
PHP Fatal error: Call to a member function createQueryBuilder() on null
please help i don't know what to do.