📜  教义 querybuilder 打印 sql - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:42.141000             🧑  作者: Mango

代码示例1
$qb = $entityManager->createQueryBuilder();

$qb->select('assoc1.thing as thing1, assoc2.thing as thing2')
    ->from(assoc1::class, 'assoc1')
    ->innerJoin(assoc2::class, 'assoc2', 'with', 'assoc1.someId = assoc2.someId')
    ->getQuery()
    ->getResult();