Hi Nitin, Please create a different topic for those questions, and look them up first.
Hydrators in doctrine are an *internal* concept, while they are a base component of ZF2, see http://framework.zend.com/manual/2.3/en/modules/zend.stdlib.hydrator.html I've described proxies in detail at http://ocramius.github.io/presentations/proxy-pattern-in-php/ Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On 14 July 2014 09:07, Nitin Singh <[email protected]> wrote: > Hi > got it working by mapping > > 'driver' => array( > 'odm_default' => array( > // 'drivers' => array( > // 'Enterprise\Model' => array( > 'class' > =>'Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver', > 'paths' => array(__DIR__ . > '/../../module/Enterprise/src/Enterprise/Model') > ) > // ) > // ) > ), > > Sorry I am a new PHP user I have used mongoose js on node. I want to know > more about hydrator and proxy could you please share some links. > thanks & regards, > Nitin. > > > On Sunday, July 13, 2014 1:55:42 PM UTC+5:30, Nitin Singh wrote: >> >> >> All documentation I have found on DoctrineMongoODMModule >> <https://github.com/doctrine/DoctrineMongoODMModule> are readme and >> paginator.md. I have verified the steps in readme but just says to copy >> dist file >> and create two folders in data. >> Could your please share me the link about mapping driver and annotated >> documents/model. >> >> regards, >> Nitin >> On Sunday, July 13, 2014 1:59:28 AM UTC+5:30, Marco Pivetta wrote: >>> >>> Hi Nitin, >>> >>> Please check the documentation and verify that you registered your >>> mapping driver correctly. >>> >>> Marco Pivetta >>> >>> http://twitter.com/Ocramius >>> >>> http://ocramius.github.com/ >>> >>> >>> On 12 July 2014 15:50, Nitin Singh <[email protected]> wrote: >>> >>>> Hi Marco, >>>> >>>> I am new PHP user and trying to create a zend 2 demo application with >>>> doctrine odm. >>>> I have followed read me https://github.com/doctrine/ >>>> DoctrineMongoODMModule >>>> I tried to use a document class with notation >>>> <?php >>>> namespace Enterprise\Model; >>>> use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM; >>>> /** >>>> * @ODM\Document(collection = "enterprises") >>>> */ >>>> class Enterprise{ >>>> /** >>>> * @ODM\Id >>>> */ >>>> private $id; >>>> /** >>>> * >>>> * @var string >>>> * @ODM\String >>>> */ >>>> private $name; >>>> /** >>>> * >>>> * @var string >>>> * @ODM\String >>>> */ >>>> private $address; >>>> } >>>> but I am also getting the same MappingException >>>> >>>> The class 'Enterprise\Model\Enterprise' was not found in the chain >>>> configured namespaces >>>> >>>> >>>> >>>> I guess I need to add the mapping for Document Path and driver class in >>>> drivers section module.doctrine-mongo-odm.local.php. >>>> could you please kindly help me out telling me the further steps. >>>> >>>> regards, >>>> Nitin >>>> >>>> >>>> On Thursday, June 20, 2013 6:31:02 PM UTC+5:30, mbneto wrote: >>>> >>>>> Hi Marco, >>>>> >>>>> Thanks for the reply. I can check but if the Drivers that you've >>>>> mention is the conf as describe at https://github.com/doctrine/ >>>>> DoctrineMongoODMModule then yes. >>>>> >>>>> I can use from the controller like the example below. btw which >>>>> property do you refer as the " dump the class metadata factory"? do >>>>> a var_dump of the DocumentManager is kind of big. >>>>> >>>>> public function indexAction() { $dm = >>>>> $this->getServiceLocator()->get('doctrine.documentmanager.odm_default'); >>>>> $user = new \MyNamespace\Model\User(); >>>>> $user->setName('mario'); >>>>> $dm->persist($user); $dm->flush(); >>>>> >>>>> } >>>>> >>>>> >>>>> >>>>> On Thu, Jun 20, 2013 at 3:59 AM, Marco Pivetta <[email protected]> >>>>> wrote: >>>>> >>>>>> I'd actually check your application's config first, and see if the >>>>>> namespaces for your drivers are actually there. >>>>>> >>>>>> You can also dump the class metadata factory of the ODM and see what >>>>>> is going on in there. >>>>>> >>>>>> Marco Pivetta >>>>>> >>>>>> http://twitter.com/Ocramius >>>>>> >>>>>> http://ocramius.github.com/ >>>>>> >>>>>> >>>>>> On 20 June 2013 04:47, mbneto <[email protected]> wrote: >>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> I am using DoctrinODM with my zf2 project and from the application >>>>>>> itself (ex. controllers) I can access and manipulate the entities >>>>>>> without a >>>>>>> problem. >>>>>>> >>>>>>> When I try to call it from the phpunit tests I get error but I don't >>>>>>> know where else should I configure the chain. In the tests I load the >>>>>>> document manager without a problem using >>>>>>> >>>>>>> $this->getApplicationServiceLocator()->get('doctrine.documen >>>>>>> tmanager.odm_default'); >>>>>>> >>>>>>> 1) MyNamespace\User\MongoOdmDaoTest::testFindByIdShouldReturn >>>>>>> Doctrine\Common\Persistence\Mapping\MappingException: The class >>>>>>> 'MyNamespace\Model\User' was not found in the chain configured >>>>>>> namespaces >>>>>>> >>>>>>> myapp/vendor/doctrine/common/lib/Doctrine/Common/Persistence >>>>>>> /Mapping/MappingException.php:38 >>>>>>> myapp/vendor/doctrine/common/lib/Doctrine/Common/Persistence >>>>>>> /Mapping/Driver/MappingDriverChain.php:114 >>>>>>> myapp/vendor/doctrine/mongodb-odm/lib/Doctrine/ODM/MongoDB/M >>>>>>> apping/ClassMetadataFactory.php:152 >>>>>>> myapp/vendor/doctrine/common/lib/Doctrine/Common/Persistence >>>>>>> /Mapping/AbstractClassMetadataFactory.php:308 >>>>>>> myapp/vendor/doctrine/common/lib/Doctrine/Common/Persistence >>>>>>> /Mapping/AbstractClassMetadataFactory.php:205 >>>>>>> myapp/vendor/doctrine/mongodb-odm/lib/Doctrine/ODM/MongoDB/D >>>>>>> ocumentManager.php:287 >>>>>>> myapp/vendor/doctrine/mongodb-odm/lib/Doctrine/ODM/MongoDB/U >>>>>>> nitOfWork.php:1753 >>>>>>> myapp/vendor/doctrine/mongodb-odm/lib/Doctrine/ODM/MongoDB/D >>>>>>> ocumentManager.php:393 >>>>>>> myapp/module/MyNamespace/tests/MyNamespaceTest/Fixtures/ >>>>>>> User/MongoOdmDao.php:43 >>>>>>> myapp/vendor/doctrine/data-fixtures/lib/Doctrine/Common/Data >>>>>>> Fixtures/Executor/AbstractExecutor.php:120 >>>>>>> myapp/vendor/doctrine/data-fixtures/lib/Doctrine/Common/Data >>>>>>> Fixtures/Executor/MongoDBExecutor.php:81 >>>>>>> myapp/module/MyNamespace/tests/MyNamespaceTest/User/MongoOdm >>>>>>> DaoTest.php:40 >>>>>>> >>>>>>> - Thanks >>>>>>> >>>>>>> -- >>>>>>> You received this message because you are subscribed to the Google >>>>>>> Groups "doctrine-user" group. >>>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>>> send an email to [email protected]. >>>>>>> To post to this group, send email to [email protected]. >>>>>>> >>>>>>> Visit this group at http://groups.google.com/group/doctrine-user. >>>>>>> For more options, visit https://groups.google.com/groups/opt_out. >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> -- >>>>>> You received this message because you are subscribed to the Google >>>>>> Groups "doctrine-user" group. >>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>> send an email to [email protected]. >>>>>> To post to this group, send email to [email protected]. >>>>>> >>>>>> Visit this group at http://groups.google.com/group/doctrine-user. >>>>>> For more options, visit https://groups.google.com/groups/opt_out. >>>>>> >>>>>> >>>>>> >>>>> >>>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "doctrine-user" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> To post to this group, send email to [email protected]. >>>> Visit this group at http://groups.google.com/group/doctrine-user. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> -- > You received this message because you are subscribed to the Google Groups > "doctrine-user" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/doctrine-user. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "doctrine-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/doctrine-user. For more options, visit https://groups.google.com/d/optout.
