我一直收到这个错误:
/* ... */
$em = $this->getDoctrine()->getEntityManager();
$movie = $em->getRepository('MyMyBundle:Movie')->findMovieByName('moviename'); // Repository Class
\Doctrine\Common\Util\Debug::dump($movie); // dumps the object just fine! The Repository found it
echo $movie->getId(); // brings me the error nevertheless
Run Code Online (Sandbox Code Playgroud)
致命错误:在......在线的非对象上调用成员函数getId()...
我的实体中有getId()方法.其他方法即使它是对象也不起作用!
对象被转储如下:
..... array(1) { [0]=> object(stdClass)#759 (59) { ["__CLASS__"]=> string( .....
Run Code Online (Sandbox Code Playgroud)
任何提示?