我在 ZF2 代码中使用 Doctrine 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 抱怨查询。确切的错误消息是:(string) [Syntax Error] line 0, col 87: Error: Expected Literal, got 'group'