jhuet / ZfcUserDoctrineMongoODM

Clone of Doctrine2 MongoDB ODM storage adapter for ZfcUser with composer support.
1 stars 1 forks source link

Question : dynamic document config path #3

Closed jmleroux closed 10 years ago

jmleroux commented 11 years ago

The document config path is fixed by the DIR directive in bootstrap event.

How do I change/overwrite the document definition (to add another field to my user) ?

jhuet commented 11 years ago

If your application is based on the Skeleton you can override any config by creating a file in config/autoload, called say module.doctrine-mongo-odm.global.php and fill it up with the same array that you'll find in module.config.php. Any data in that new file will be merged and override those, so you may only set there the data you really need to change.

Nonetheless, this is not how you'll be able to add a new field in your user document. To do so you will have to copy this file into your config/autoload directory and remove the .dist extension. In there, change the user_entity_class value to your own entity extending the original one and with the new field you want to add.