Skip to content

Commit 260f18c

Browse files
committed
Make it possible to auto map with multiple OMs
1 parent 3baea1f commit 260f18c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,16 @@ abstract class AbstractDoctrineExtension extends Extension
4242
/**
4343
* @param array $objectManager A configured object manager.
4444
* @param ContainerBuilder $container A ContainerBuilder instance
45+
* @param array $mappedBundles A list of explicitly mapped Bundles
4546
*
4647
* @throws \InvalidArgumentException
4748
*/
48-
protected function loadMappingInformation(array $objectManager, ContainerBuilder $container)
49+
protected function loadMappingInformation(array $objectManager, ContainerBuilder $container, array $mappedBundles = array())
4950
{
5051
if ($objectManager['auto_mapping']) {
5152
// automatically register bundle mappings
5253
foreach (array_keys($container->getParameter('kernel.bundles')) as $bundle) {
53-
if (!isset($objectManager['mappings'][$bundle])) {
54+
if (!isset($mappedBundles[$bundle]) && !isset($objectManager['mappings'][$bundle])) {
5455
$objectManager['mappings'][$bundle] = array(
5556
'mapping' => true,
5657
'is_bundle' => true,

0 commit comments

Comments
 (0)