Skip to content
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

Multiple entity managers #39

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

h3llr4iser
Copy link

This PR enhances the DoctrineORMInfo class in the A2lix\AutoFormBundle to better support applications that use multiple Doctrine entity managers.

Previously, this class was directly creating an EntityManager which can cause compatibility issues when the application requires different EntityManager instances for different classes.

Now, the DoctrineORMInfo service utilizes the ManagerRegistry service. The ManagerRegistry service is used to retrieve the appropriate EntityManager for a given class. This allows for better compatibility with applications that use multiple entity managers.

The changes include:

Replaced the ClassMetadataFactory with the ManagerRegistry in DoctrineORMInfo.
Updated the methods getFieldsConfig, getAssociationTargetClass, getAssocsConfig and getMetadata to use the new manager registry.
Updated the DoctrineORMInfo service definition.
Updated test cases to reflect these changes.

The PR addresses the problem raised in issue #16 .

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.

1 participant