In a bundle I'm developing and was working correctly I added a new functionality which involves adding a repository to the entity. Now, when I execute the newly added method I get the following error:
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
The newly added code is:
Controller:
/**
* 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;
}
Repository:
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();
}
}
That's all that has changed... if any more code is needed for clarification I will post it.
So could anybody tell me what I'm doing wrong? I couldn't find anything neither on SO nor on Google.
Thanks in advance