将左连接查询构建器结果发送到twig

时间:2014-10-07 06:45:33

标签: php symfony doctrine-orm silex query-builder

我有一个带有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')

完美运作

0 个答案:

没有答案