Doctrine orm doctrine2查询生成器有什么问题-应为文本

Doctrine orm doctrine2查询生成器有什么问题-应为文本,doctrine-orm,zend-framework2,Doctrine Orm,Zend Framework2,我正在ZF2代码中使用原则2,并且我正在尝试编写更新查询。 代码如下: $qb = $this->getEntityManager()->createQueryBuilder(); $qb->update('Application\Entity\Groups', 'group') ->set('group.state', '?1') ->set('group.modified', '?2')

我正在ZF2代码中使用原则2,并且我正在尝试编写更新查询。 代码如下:

    $qb = $this->getEntityManager()->createQueryBuilder();
    $qb->update('Application\Entity\Groups', 'group')
            ->set('group.state', '?1')
            ->set('group.modified', '?2')
            ->where($qb->expr()->eq('group.id', '?3'))
            ->setParameter(1, \Application\Entity\Groups::STATE_DELETED)
            ->setParameter(2, $modified)
            ->setParameter(3, $group_id);
Doctrine2抱怨查询。确切的错误消息是:
(字符串)[语法错误]第0行,第87列:错误:应为文字,得到“组”

关键字组似乎产生了问题。当我使用gr alias而不是group时,效果很好。 因此,DQL bellow起了作用:

    $qb = $this->getEntityManager()->createQueryBuilder();
    $qb->update('Application\Entity\Groups', 'gr')
            ->set('gr.state', ':state')
            ->set('gr.modified', ':modified')
            ->where($qb->expr()->eq('gr.id', ':group_id'))
            ->setParameter('group_id', $group_id)
            ->setParameter('state', \Application\Entity\Groups::STATE_DELETED)
            ->setParameter('modified', $modified);