Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/08/2013, 20:18
minimal
 
Fecha de Ingreso: diciembre-2011
Mensajes: 408
Antigüedad: 12 años, 3 meses
Puntos: 18
doctrine2 zend framework 2 repository class no carga

hola tengo un problema con zend framework 2 y doctrine no me esta cargando las clases de repositorio

Código PHP:
/**
 *
 * @ORM\Entity(repositoryClass="Blog\Repository\CategoryRepository")
 * @ORM\Table(name="post_categories")
 * @ORM\Entity
 */
class Category

la ruta del repositorio es la siguiente

module/Blog/src/Blog/Repository\CategoryRepository.php

en mi controlador

Código PHP:
namespace BlogController;

use 
ZendMvcControllerAbstractActionController;
use 
ZendViewModelViewModel;
use 
DoctrineORMEntityManager;
use 
DoctrineCommonCollectionsArrayCollection;
use 
DoctrineModulePaginatorAdapterCollection as Adapter;
use 
ZendPaginatorPaginator;

class 
CategoryController extends AbstractActionController
{
    protected 
$entityManager;
    
    protected function 
setEntityManager(EntityManager $em)
    {
        
$this->entityManager $em;
        return 
$this;
    }

    protected function 
getEntityManager()
    {

        if (
is_null($this->entityManager)) 
        {
          
          
$this->setEntityManager($this->getServiceLocator()->get('Doctrine\ORM\EntityManager'));
        
        }
    
    return 
$this->entityManager;
    
    } 

    public function 
indexAction()
    {

        
$em $this->getEntityManager();
       
        
$categories $em->getRepository('Blog\Entity\Category');
        
        
$paginator = new Paginator(new Adapter($categories->ListCategoryQuery()));

        
$paginator
        
->setCurrentPageNumber(1)
        ->
setItemCountPerPage(5);


        return new 
ViewModel(
            array(
                
'categories' => $paginator
            
)
        );

    } 
el error que obtengo es el siguiente

Undefined method 'ListCategoryQuery'. The method name must start with either findBy or findOneBy!