doctrine / phpcr-odm

Doctrine PHPCR ODM
http://www.doctrine-project.org/projects/phpcr-odm.html
MIT License
183 stars 97 forks source link

Add generate documents command #361

Open wouterj opened 11 years ago

wouterj commented 11 years ago

Both the ORM and MongoDB ODM have a command which creates getters and setters, based on the mapping data. The PHPCR ODM should also provide something this command.

I'm in doubt what the command name should be. The ORM uses orm:generate:entities and the MongoDB ODM uses odm:generate:documents. Some suggestions:

For the last 2 suggestions, I would prefer to rename the MongoDB ODM command too.

I'll start working on this one, but I would like to discuss the best name.

dantleech commented 11 years ago

I think doctrine:phpcr:generate:documents would be most consistent with what we already have.

wouterj commented 11 years ago

I see, but that means all commands for phpcr odm are inconsistent with other doctrine projects.

dantleech commented 11 years ago

ORM:

$ php app/console doctrine:generate:entities AcmeBlogBundle

MongoDB:

$ php app/console doctrine:mongodb:generate:documents AcmeStoreBundle

PhpcrOdm

$ php app/console doctrine:phpcr:generate documents AcmeStoreBundle

The latter two are the "bundled" commands, i.e. they wrap odm:generate:documents and I guess what would be phpcr:generate:documents in the PHPCR\Commands.

dantleech commented 11 years ago

hmm ignore what I said about wrapping a PHPCR command - that makes no sense at all :)

wouterj commented 11 years ago

@dantleech, all commands you show are the commands of the bundles (DoctrineBundle and DoctrineMongoDbBundle). Those bundles extend a command that is defined in their library (resp. orm and mongodb odm). In this issue, I'm not talking about the command names for the DoctrinePHPCRBundle, but about the command names of the phpcr-odm library (so the command you use when using phpcr odm standalone).

dantleech commented 11 years ago

Hmm. A dilema. phpcr:generate:documents would indeedbe wrong. @dbu

Wouter J notifications@github.com wrote:

@dantleech, all commands you show are the commands of the bundles (DoctrineBundle and DoctrineMongoDbBundle). Those bundles extend a base command, which is defined in their library (resp. orm and mongodb odm). In this issue, I'm not talking about the command names for the DoctrinePHPCRBundle, but about the command names of the phpcr-odm library.


Reply to this email directly or view it on GitHub: https://github.com/doctrine/phpcr-odm/issues/361#issuecomment-26522487

Sent from my Android device with K-9 Mail. Please excuse my brevity.

dbu commented 11 years ago

I think the so far we called all phpcr-odm specific commands doctrine:phpcr:... Which seems inconsistent with the rest of doctrine, but has the benefit of being consistent with the symfony bundle command names. Which imho is what counts more, as people will read library documentation and symfony cmf documentation. so i would be all for doctrine:phpcr:...

dbu commented 10 years ago

in #415 i add the helper to filter (for the proxy generation command). this is used by the orm to filter what documents should be generated.

to actually do this, we could either copy the generator from orm (and mongo and whatever), or we can check if there is potential for a common generator abstraction and see if we can move that to commons - the interest for that seems not that big: https://twitter.com/dbu/statuses/431716020915429376