ppi / framework

The PPI Framework Engine
http://www.ppi.io
MIT License
154 stars 30 forks source link

[DataSource] Provide Doctrine ORM Support #81

Open dragoonis opened 11 years ago

dragoonis commented 11 years ago

DoctrineORM support can be very quickly achieved by pulling in the Zend communities DoctrineORMModule. This is maintained primarily by @ocramius and @bakura10.

A clear plan needs laid out on how to, at a very high-level, take configuration details from ./app/config/datasource.php and pass them over to the DoctrineORMModule for it to work its magic.

Some important links referenced by the zend guys above are:

bakura10 commented 11 years ago

As I told you on IRC, I think the easiest way if you want to keep your structure for config is to simply override the factories here: https://github.com/doctrine/DoctrineModule/blob/master/config/module.config.php#L68-L75

Ocramius commented 11 years ago

DoctrineModule 0.8.x uses abstract factories to handle the "multiple entity manager" problem... What are you exactly trying to do, paul?

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/

On 10 May 2013 22:30, Michaël Gallego notifications@github.com wrote:

As I told you on IRC, I think the easiest way if you want to keep your structure for config is to simply override the factories here: https://github.com/doctrine/DoctrineModule/blob/master/config/module.config.php#L68-L75

— Reply to this email directly or view it on GitHubhttps://github.com/ppi/framework/issues/81#issuecomment-17742829 .

dragoonis commented 11 years ago

@Ocramius users currently manage their DB connections/credentials via a global application file, see here: https://github.com/ppi/skeletonapp/blob/2.1/app/config/datasource.php

I want to let DoctrineORM users setup their credentials using the same manner as the link above, and then we hand that information over to DoctrineModule to start booting up all the Doctrine goodness.

Essentially I don't want to modify any of Doctrine, or DoctrineORM module but really just hand over credentials.

Does this make sense? how would you go about it?

Ocramius commented 11 years ago

You can just merge these configs into the module's config

dragoonis commented 11 years ago

Can you provide a link to the module's config, to make sure we're looking in the right place

Ocramius commented 11 years ago

https://github.com/doctrine/DoctrineORMModule/blob/master/config/module.config.php

for the ODM:

https://github.com/doctrine/DoctrineMongoODMModule/blob/master/config/module.config.php

dragoonis commented 11 years ago

Looks like for ORM support we just need to pass credentials to here: https://github.com/doctrine/DoctrineORMModule/blob/master/config/module.config.php#L35

For ODM support, we pass credentials into here: https://github.com/doctrine/DoctrineMongoODMModule/blob/master/config/module.config.php#L6

Ocramius commented 11 years ago

Correct

dragoonis commented 8 years ago

Done

dragoonis commented 8 years ago

Needs documentation.