-
-
Notifications
You must be signed in to change notification settings - Fork 455
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
Add aliases to help autowiring #640
Conversation
fb1c2e9
to
0ce61a3
Compare
@@ -126,6 +126,7 @@ protected function dbalLoad(array $config, ContainerBuilder $container) | |||
|
|||
$container->setAlias('database_connection', sprintf('doctrine.dbal.%s_connection', $this->defaultConnection)); | |||
$container->setAlias('doctrine.dbal.event_manager', new Alias(sprintf('doctrine.dbal.%s_connection.event_manager', $this->defaultConnection), false)); | |||
$container->setAlias('Doctrine\DBAL\Driver\Connection', new Alias('database_connection', false)); |
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.
I suggest putting this directly in dbal.xml, as it does not need to be dynamic based on the configuration
@@ -373,6 +374,8 @@ protected function ormLoad(array $config, ContainerBuilder $container) | |||
} | |||
|
|||
$container->setAlias('doctrine.orm.entity_manager', sprintf('doctrine.orm.%s_entity_manager', $config['default_entity_manager'])); | |||
$container->setAlias('Doctrine\ORM\EntityManagerInterface', new Alias('doctrine.orm.entity_manager', false)); | |||
$container->setAlias('Doctrine\Common\Persistence\ObjectManager', new Alias('doctrine.orm.entity_manager', false)); |
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.
same for these (but in orm.xml)
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.
done
7842250
to
38748da
Compare
@@ -116,36 +116,6 @@ public function testGetUnknownEntityManager() | |||
$registry->getManager('default'); | |||
} | |||
|
|||
public function testResetDefaultEntityManager() |
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.
these two tests rely on deprecated behavior, and do not test things in the bundle, be behavior in the doctrine bridge. Since it's not the responsibility of the bundle to test the bridge, they can and should be removed.
Remaining failure will be fixed once symfony/symfony#22164 is merged up to 2.8. |
38748da
to
e421a83
Compare
Thank you @nicolas-grekas. |
This PR was merged into the 1.6.x-dev branch. Discussion ---------- Add aliases to help autowiring Commits ------- e421a83 Add aliases to help autowiring
No description provided.