0

I am trying to setup a zf1 + doctrine mongo odm 1.0.0BETA4-DEV project. I am using https://github.com/Bittarman/zf-d2-odm branch but when I update doctrine version from 1.0.0BETA3 to 1.0.0BETA4-DEV, I get the following error:

 SCREAM: Error suppression ignored for
 ( ! ) Fatal error: Call to undefined method Doctrine\Common\Annotations\AnnotationReader::setDefaultAnnotationNamespace() in C:\htdocs\zf-d2-odm\library\Lupi\Resource\Odm.php on line 34
 Call Stack
 #  Time    Memory  Function    Location
 1  0.0007  139368  {main}( )   ..\index.php:0
 2  0.0217  659008  Zend_Application->bootstrap( )  ..\index.php:25
 3  0.0217  659104  Zend_Application_Bootstrap_BootstrapAbstract->bootstrap( )  ..\Application.php:355
 4  0.0217  659120  Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap( ) ..\BootstrapAbstract.php:586
 5  0.0314  1127240 Zend_Application_Bootstrap_BootstrapAbstract->_executeResource( )   ..\BootstrapAbstract.php:626
 6  0.0314  1127368 Lupi_Resource_Odm->init( )  ..\BootstrapAbstract.php:683
dextervip
  • 4,999
  • 16
  • 65
  • 93

2 Answers2

3

I found new method usage in the lastest raw documentation

 https://github.com/doctrine/mongodb-odm-documentation

First you should call AnnotationDriver::registerAnnotationClasses() which registers annotation classes to the common registry.

AnnotationDriver::registerAnnotationClasses();

Then configure normally all paths and set meta data driver with factory method for the annotation driver AnnotationDriver::create()

$config = new Configuration();
$config->setProxyDir('/path/to/generate/proxies');
$config->setProxyNamespace('Proxies');
$config->setHydratorDir('/path/to/generate/hydrators');
$config->setHydratorNamespace('Hydrators');
$config->setMetadataDriverImpl(AnnotationDriver::create('/path/to/document/classes'));

$dm = DocumentManager::create(new Connection(), $config);
dextervip
  • 4,999
  • 16
  • 65
  • 93
1

That method doesnt exist anymore. Youll need to modify Lupi_Resource_Odm::init() with updated API calls.

prodigitalson
  • 60,050
  • 10
  • 100
  • 114
  • I dunno never used that library before. If the person who created the lib for ZF hasnt updated it then youll either have to update it yourself to work with the new API or use a compatible version of the ODM like you were before. – prodigitalson Jun 22 '12 at 21:34