我不断收到此错误:
/* ... */
$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
致命错误:在线调用 ... 中的非对象上的成员函数 getId()
我的实体中有 getId() 方法。即使它是和对象,其他方法也不起作用!
该对象被转储为:
..... array(1) { [0]=> object(stdClass)#759 (59) { ["__CLASS__"]=> string( .....
有什么提示吗?