Skip to content

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