Add tbe following to your config.yml:

doctrine_odm.mongodb:
    auto_generate_hydrator_classes: true

On Jan 17, 11:30 pm, Jérôme TEXIER <jerome.tex...@gmail.com> wrote:
> Hi,
>
> I'm currently playing with Symfony2 PR4 and Doctrine2 ODM.
> I've defined a document class called "Image" which relies on an
> existant mongodb collection.
>
> When I run a query to its related document repository (which is
> Doctrine\ODM\MongoDB\DocumentRepository by default),
> $image = 
> $dm->getRepository('Application\CmxBundle\Document\Image')->findOneById($id);
>
> I get the following error message :
>
> Fatal error: Doctrine\ODM\MongoDB\Hydrator
> \HydratorFactory::getHydratorFor(): Failed opening required '/Users/
> jerome/Sites/cmx/frontend/app/cache/dev/doctrine/odm/mongodb/Hydrators/
> ApplicationCmxBundleDocumentImageHydrator.php' (include_path='.:/usr/
> local/lib/php') in /Users/jerome/Sites/cmx/frontend/src/vendor/
> doctrine-mongodb-odm/lib/Doctrine/ODM/MongoDB/Hydrator/
> HydratorFactory.php on line
>
> As mentioned by the error message, the required Hydrator class
> (ApplicationCmxBundleDocumentImageHydrator.php) doesn't exist on
> cache.
> I have no idea why this class is missing and why it has not been
> generated by doctrine odm.
>
> Note that
> count($dm->getRepository('Application\CmxBundle\Document\Image')->findAll()) 
> returns the expected number of elements so config looks ok
>
> and doctrine odm is running against the right collection.
>
> Any suggestions ?

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to