如我们所知,如果更新记录,我们将返回布尔值,但是如果我想要返回主键ID。我该如何编写querybuilder?
$dq = $this->repository->createQueryBuilder('u');
$query = $dq->update()
->set('u.isLocked', $dq->expr()->literal(true))
->where('u.token = :token and u.isDeleted = :isDeleted')
->setParameter('isDeleted', false)
->setParameter('token', $token)
->getQuery();
return $this->execute($query);