Skip to content

Commit

Permalink
[DoctrineBundle] removed the possibility to use auto_mapping when you…
Browse files Browse the repository at this point in the history
… have more than one entity manager
  • Loading branch information
fabpot committed Apr 27, 2011
1 parent dc85727 commit c752429
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -169,6 +169,10 @@ protected function ormLoad(array $config, ContainerBuilder $container)
*/
protected function loadOrmEntityManager(array $entityManager, ContainerBuilder $container)
{
if ($entityManager['auto_mapping'] && count($container->getParameter('doctrine.orm.entity_managers')) > 1) {
throw new \LogicException('You cannot enable "auto_mapping" when several entity managers are defined.');
}

$ormConfigDef = $container->setDefinition(sprintf('doctrine.orm.%s_configuration', $entityManager['name']), new DefinitionDecorator('doctrine.orm.configuration'));

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

0 comments on commit c752429

Please sign in to comment.