Well done. I agree that with the actual lack of documentation, playing with Symfony2 could be sometimes enigmatic...
On 18 jan, 12:58, Damon Jones <[email protected]> wrote: > You're welcome, I'm glad I could help. > > I had the same problem and I couldn't find anything in the Symfony2 or > Doctrine documentation. I spent a few hours scratching my head and > eventually figured out that there was probably a config setting like > the autogenerate proxies one and looked through the xml configuration > to figure it what it was called. > > On Jan 18, 12:45 pm, Jérôme TEXIER <[email protected]> wrote: > > > > > > > > > That works ! Thanks a lot. > > It was quite simple indeed. > > Where do you find that on the documentation ? > > > On 18 jan, 01:00, Damon Jones <[email protected]> wrote: > > > > 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 <[email protected]> wrote: > > > > > Hi, > > > > > I'm currently playing with Symfony2 PR4 and Doctrine2ODM. > > > > 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 doctrineodm. > > > > > Note that > > > > count($dm->getRepository('Application\CmxBundle\Document\Image')->findAll() > > > > ) returns the expected number of elements so config looks ok > > > > > and doctrineodmis 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
