无法从多个表中检索数据

时间:2013-07-12 08:56:57

标签: symfony doctrine

我编写了以下查询构建器语句但它总是返回null,除非我删除“andWhere”子句。有什么想法吗?

$userQuery = $usersRepo->createQueryBuilder('u', 'ud')
                        ->select('u.id')                           
                        ->from('Test\Bundle\Entity\UserDetails', 'ud')
                        ->where('u.userdetailsid = ud.id')
                        ->andWhere('ud.passwordtoken = :tokenid')
                        ->setParameter('tokenid', $em->createQueryBuilder()->expr()->literal($tokenid))
                        ->getQuery();   

                $test = $userQuery->execute();

0 个答案:

没有答案