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

[GH-8327] Make EntityManagerProvider compatible with expected DoctrineBundle usage #8646

Merged
merged 3 commits into from
Apr 25, 2021

Conversation

beberlei
Copy link
Member

@beberlei beberlei commented Apr 20, 2021

This complication of the EntityManagerProvider API with a new method is necessary, because during integration in DoctrineBundle doctrine/DoctrineBundle#1327 it showed that their em option defaults to NULL, which isn't compatible with ORM using default as the default value.

Related #8327 #8524

Fixes #8643

@beberlei beberlei changed the title [GH-8327] Make EntityManagerProvider compatible with expected Doctrin… [GH-8327] Make EntityManagerProvider compatible with expected DoctrineBundle usage Apr 20, 2021
@beberlei beberlei added this to the 2.9.0 milestone Apr 20, 2021
}

public function getDefaultConnection(): Connection
{
return $this->entityManagerProvider->getManager('default')->getConnection();
return $this->entityManagerProvider->getManager($this->defaultManagerName)->getConnection();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder whether this should leverage EntityManagerProvider::getDefaultManager() now when we have it (if $defaultManagerName was not provided).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you are right, this would be better.

@beberlei beberlei merged commit e1388fa into doctrine:2.9.x Apr 25, 2021
@beberlei beberlei deleted the GH-8327-BundleCompatibility branch April 25, 2021 17:44
simPod added a commit to simPod/orm that referenced this pull request May 4, 2021
beberlei pushed a commit that referenced this pull request May 5, 2021
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.

2 participants