我findOneBy
在我的实体中找到(使用)单行。这是代码:
$userown = $this->getDoctrine()->getRepository('GameShelfUsersBundle:Own')
->findOneBy(array(
'game' => $game->getId(),
'user' => $em->getRepository('GameShelfUsersBundle:User')->find($session->getId())
));
现在我将它作为userown
. 但是当我尝试使用 twig 打印它时{{ userown.typo }}
,它会引发错误:
An exception has been thrown during the rendering of a template ("Catchable Fatal Error: Object of class Proxies\__CG__\GameShelf\UsersBundle\Entity\OwnState could not be converted to string in D:\!!XAMPP\htdocs\
我的实体在这里。