Doctrine 2与zend框架集成1

时间:2014-02-13 09:15:01

标签: php zend-framework doctrine-orm

 Message: Class Application\Entity\Article does not exist

堆栈追踪:

#0 /var/www/firsthelp/library/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php(73): ReflectionClass->__construct('Application\Ent...')
#1 /var/www/firsthelp/library/Doctrine/ORM/Mapping/ClassMetadataInfo.php(867): Doctrine\Common\Persistence\Mapping\RuntimeReflectionService->getClass('Application\Ent...')
#2 /var/www/firsthelp/library/Doctrine/ORM/Mapping/ClassMetadataFactory.php(517): Doctrine\ORM\Mapping\ClassMetadataInfo->initializeReflection(Object(Doctrine\Common\Persistence\Mapping\RuntimeReflectionService))
#3 /var/www/firsthelp/library/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php(300): Doctrine\ORM\Mapping\ClassMetadataFactory->initializeReflection(Object(Doctrine\ORM\Mapping\ClassMetadata), Object(Doctrine\Common\Persistence\Mapping\RuntimeReflectionService))
#4 /var/www/firsthelp/library/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php(205): Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->loadMetadata('Application\Ent...')
#5 /var/www/firsthelp/library/Doctrine/ORM/EntityManager.php(268): Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->getMetadataFor('Application\Ent...')
#6 /var/www/firsthelp/library/Doctrine/ORM/EntityManager.php(682): Doctrine\ORM\EntityManager->getClassMetadata('Application\Ent...')
#7 /var/www/firsthelp/application/modules/user/controllers/UserController.php(632): Doctrine\ORM\EntityManager->getRepository('\Application\En...')
#8 /var/www/firsthelp/library/Zend/Controller/Action.php(516): User_UserController->configurationAction()
#9 /var/www/firsthelp/library/Zend/Controller/Dispatcher/Standard.php(295): Zend_Controller_Action->dispatch('configurationAc...')
#10 /var/www/firsthelp/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#11 /var/www/firsthelp/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#12 /var/www/firsthelp/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#13 /var/www/firsthelp/public/index.php(52): Zend_Application->run()
#14 {main}     

任何人都可以帮助我做错了什么。我正在关注[Bisna](http://www.ibm.com/developerworks/web/library/os-doctrine-php-zend/index.html)。

2 个答案:

答案 0 :(得分:0)

可能的解决方案:

  1. 设置appnamespace =“”(application.ini)
  2. 确保将Application名称空间与您的实体一起使用

答案 1 :(得分:0)

找到解决方案:

http://hectorpinol.com/zend-framework-1-11-and-doctrine-2-2-x-integration

并在php.ini中检查是否启用了pdo_mysql扩展