我在请求中抛出 NonUniqueResultException 时遇到问题
public function getLastViewUpdate($view)
{
$qb = $this->getEntityManager()->createQueryBuilder();
$result = $qb->select('vu')
->from('EasyApp\ApplicationBundle\Entity\ViewUpdate', 'vu')
->where('vu.view = :view')
->orderBy('vu.date','DESC')
->setParameter('view', $view)
->getQuery()
->getSingleResult();
return $result;
}
但我不知道为什么,我可能要导入一些东西,但我找不到
CRITICAL - Uncaught PHP Exception Doctrine\ORM\NonUniqueResultException: "" at /Users/antoine/Documents/projects/easyApp/application/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php line 621
谢谢你的帮助