번들에서 올바르게 개발 중이며 올바르게 작동했습니다. 엔티티에 리포지토리를 추가하는 것과 관련된 새로운 기능이 추가되었습니다.엔터티/리포지토리에서 Class_parents 오류
Warning: class_parents() [function.class-parents]: Class CmsPages does not exist and could not be loaded in /Applications/MAMP/htdocs/symfony-standard-2.1/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php line 40
새로 추가 된 코드는 다음과 같습니다 :
컨트롤러 :
/**
* Returns an json formated tree
*
* @Route("/getTree", name="admin_cmsPages_getTree", options={"expose"=true})
*/
public function getTreeAction()
{
$em = $this->getDoctrine()->getManager();
$tree = $em->getRepository('CmsPages')->loadTree();
$response = new Response(json_encode($tree));
$response->headers->set('Content-Type', 'application/json');
return $response;
}
저장소 :
namespace Yanic\CmsBundle\Entity;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\NoResultException;
class CmsPagesRepository extends EntityRepository
{
public function loadTree()
{
$q = $this
->createQueryBuilder('p')
->select('p')
->orderBy('p.lft')
->getQuery()
;
return $q->getArrayResult();
}
}
내가 새로 추가 된 방법을 실행할 때 지금, 나는 다음과 같은 오류가 그게 전부입니다 ... 만약 더 많은 코드가 필요하다면 나는 그것을 게시 할 것입니다.
아무도 내가 잘못하고있는 것을 말해 줄 수 있습니까? 나는 SO 나 Google 어느 것도 찾을 수 없었습니다. 사전에
덕분에
아마도 당신을 위해 유용 할 수있다 : HTTP : //stackoverflow.com/questions/11686922/symfony2-1-mapping-error-class-parents/11691357#11691357 – unairoldan