나는이 오류가 계속 :Symfony2 : 객체가 있더라도 비 객체의 getId() 멤버 함수를 호출 하시겠습니까?
/* ... */
$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(.....
어떤 힌트 :
객체는 같은 싣는다?
맞춤 엔터티 저장소를 사용하고 있습니까? 그렇다면'findMovieByName' 메소드를 게시하십시오. – gilden
고마워요. 예, 맞춤 엔터티 저장소였습니다. 그러나 나는 대답을 발견했다. (약 1 시간 쯤 걸렸습니다.) :) 감사! – Mike