8000 [DoctrineBundle] removed the possibility to use auto_mapping when you… · beenalee/symfony@c752429 · GitHub 8000
[go: up one dir, main page]

Skip to content

Commit c752429

Browse files
committed
[DoctrineBundle] removed the possibility to use auto_mapping when you have more than one entity manager
1 parent dc85727 commit c752429

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ protected function ormLoad(array $config, ContainerBuilder $container)
169169
*/
170170
protected function loadOrmEntityManager(array $entityManager, ContainerBuilder $container)
171171
{
172+
if ($entityManager['auto_mapping'] && count($container->getParameter('doctrine.orm.entity_managers')) > 1) {
173+
throw new \LogicException('You cannot enable "auto_mapping" when several entity managers are defined.');
174+
}
175+
172176
$ormConfigDef = $container->setDefinition(sprintf('doctrine.orm.%s_configuration', $entityManager['name']), new DefinitionDecorator('doctrine.orm.configuration'));
173177

174178
$this->loadOrmEntityManagerMappingInformation($entityManager, $ormConfigDef, $container);

0 commit comments

Comments
 (0)
0