odoctrine querybuilder print sql

Solutions on MaxInterview for odoctrine querybuilder print sql by the best coders in the world

showing results for - "odoctrine querybuilder print sql"
Giulio
22 Feb 2019
1$qb = $entityManager->createQueryBuilder();
2
3$query = $qb->select('assoc1.thing as thing1, assoc2.thing as thing2')
4    ->from(assoc1::class, 'assoc1')
5    ->innerJoin(assoc2::class, 'assoc2', 'with', 'assoc1.someId = assoc2.someId')
6    ->getQuery();
7
8$sql = $query->getSQL();
9
10var_dump($sql);