Symfony2: ¿Llamar a una función miembro getId () en un no-objeto aunque haya un objeto?
Sigo recibiendo este error:
/* ... */
$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
Error grave: llamar a una función miembro getId () en un no-objeto en ... en línea ...
Tengo el método getId () en mi Entidad. Otros métodos tampoco funcionan aunquees y objeto!
El objeto se descarga como:
..... array(1) { [0]=> object(stdClass)#759 (59) { ["__CLASS__"]=> string( .....
¿Alguna pista?