我有一个带有doctrine querybuilder的左连接
$registros = $this->em->createQueryBuilder();
$registros->select('u,v')
->from('Entity\RegistroCam', 'u')
->leftjoin('Entity\CmMunicipios','v','WITH','u.camMunicipio = v.idMunicipio')
->orderBy('u.camPaterno', 'DESC');
$query = $registros->getQuery();
// Execute Query
$result = $query->getResult();
我的问题是当我将结果发送到twig时,它会抛出以下错误
Twig_Error_Runtime: Method "idRegistro" for object "Entity\CmMunicipios" does not exist in "adminPanel.twig.html" at line 87
如果我写
$registros->select('u')
完美运作