当我尝试使用此查询时:
$repository = $this->getDoctrine()
->getRepository('AcmeCommentoBundle:Commento');
$query = $repository->createQueryBuilder('p')
->select('DISTINCT p.user')
->where('p.annuncio = :annuncio')
->setParameter('annuncio', $annuncio)
->getQuery();
$utenti = $query->getResult();
它返回此错误:
[Semantical Error] line 0, col 18 near
'user FROM Acme\CommentoBundle\Entity\Commento':
Error: Invalid PathExpression. Must be a StateFieldPathExpression.
这个错误是什么意思?