-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[WCM] document the doctrine compiler pass #2507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
could you please at the pull request format to your PR? |
.. note:: | ||
|
||
When building a reusable bundle, model classes should be placed in the | ||
``Model`` namespace. See doc:`../doctrine/mapping_model_classes` for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use /cookbook/doctrine/mapping_model.classes
|
||
In your bundle class, write the following code to register the compiler pass:: | ||
|
||
use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is still a bit too long. should i break it as well? and if so, how?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dbu no, namespaces (and CLI commands) are exceptions on this 85 characters rule. They can't be wrapped.
i added doc for mongodb, it should now become visible how this thing is going to work. |
[WCM] document the doctrine compiler pass
Hi David! Nice docs PR for a very nice feature. I only made very minor tweaks. Thanks! |
thanks. i will do a new PR once i add this to doctrine phpcr-odm too. the doctrine couchdb bundle is not really usable (tests failing, wants symfony 2.1 max) so for now nothing will happen with it, i fear. |
This PR was squashed before being merged into the master branch (closes symfony#7599). Discussion ---------- [Doctrine-Bridge] add a base compiler pass class to register doctrine mappings | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | not on code, but defining best practices | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | symfony/symfony-docs#2507 Reusable bundles providing model classes should not rely on the automapping provided by the doctrine bundles. What is more, the same model can often be mapped to Doctrine ORM, MongoODM, CouchODM and PHPCR-ODM. This pull request adds a base class for a compiler pass that the concrete doctrine bundles extend to provide a default compiler pass that makes it trivial for bundles to register their mappings. See doctrine/DoctrineBundle#177 The FOSUserBundle shows how this would look in practice. See FriendsOfSymfony/FOSUserBundle#1081 I will create the documentation pull request as well as pull requests for the mongo, couch and phpcr bundles once we agree how exactly to do this. Commits ------- 099fd9f [Doctrine-Bridge] add a base compiler pass class to register doctrine mappings
This PR was merged into the master branch. Discussion ---------- fix register mappings pass to only register mappings with one object manager | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | yes (but feature is totally new) | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#7599 | License | MIT | Doc PR | symfony/symfony-docs#2507 This PR fixes the issues @stof discovered in symfony#7599 - we now introduce a way to only register the mappings with one of the object managers. Commits ------- fc12bd1 fix register mappings pass to only register mappings with one object manager
not sure if this should go to master or the 2.2 branch? the feature is not yet merged.