Skip to content

[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

Merged
merged 3 commits into from
May 3, 2013
Merged

[WCM] document the doctrine compiler pass #2507

merged 3 commits into from
May 3, 2013

Conversation

dbu
Copy link
Contributor

@dbu dbu commented Apr 15, 2013

Q A
Doc fix? no
New docs? yes (symfony/symfony#7599)
Applies to master, not sure about 2.2
Fixed tickets

not sure if this should go to master or the 2.2 branch? the feature is not yet merged.

@wouterj
Copy link
Member

wouterj commented Apr 15, 2013

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
Copy link
Member

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;
Copy link
Contributor Author

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?

Copy link
Member

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.

@dbu
Copy link
Contributor Author

dbu commented Apr 17, 2013

i added doc for mongodb, it should now become visible how this thing is going to work.

weaverryan added a commit that referenced this pull request May 3, 2013
[WCM] document the doctrine compiler pass
@weaverryan weaverryan merged commit bf18528 into symfony:master May 3, 2013
weaverryan added a commit that referenced this pull request May 3, 2013
@weaverryan
Copy link
Member

Hi David!

Nice docs PR for a very nice feature. I only made very minor tweaks.

Thanks!

@dbu
Copy link
Contributor Author

dbu commented May 4, 2013

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.

ondrejmirtes pushed a commit to ondrejmirtes/symfony that referenced this pull request Nov 25, 2013
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
ondrejmirtes pushed a commit to ondrejmirtes/symfony that referenced this pull request Nov 25, 2013
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
@dbu dbu deleted the document-reusable-bundle-model branch July 29, 2014 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants