private function addDriverInDriverChain(
        ContainerBuilder $container,
        EntityMapping $entityMapping
    ) {
        $chainDriverDefinition = $container
            ->getDefinition(
                'doctrine.orm.' . $entityMapping->getEntityManagerName() . '_metadata_driver'
            );

        $container->setParameter(
            'doctrine.orm.metadata.driver_chain.class',
            'Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain'
        );

        $chainDriverDefinition->addMethodCall('addDriver', [
            new Reference(
                'doctrine.orm.' . $entityMapping->getUniqueIdentifier() . '_metadata_driver'
            ),
            $entityMapping->getEntityNamespace(),
        ]);
    }
private function addDriverInDriverChain(
        ContainerBuilder $container,
        EntityMapping $entityMapping
    ) {
        $chainDriverDefinition = $container
            ->getDefinition(
                'doctrine.orm.' . $entityMapping->getEntityManagerName() . '_metadata_driver'
            );

        $container->setParameter(
            'doctrine.orm.metadata.driver_chain.class',
            'Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain'
        );

        $chainDriverDefinition->addMethodCall('addDriver', [
            new Reference(
                'doctrine.orm.' . $entityMapping->getUniqueIdentifier() . '_metadata_driver'
            ),
            $entityMapping->getEntityNamespace(),
        ]);
    }
private function addDriverInDriverChain ( ContainerBuilder $ container , EntityMapping $ entityMapping ) { $ chainDriverDefinition = $ container -> getDefinition ( 'doctrine.orm.' . $ entityMapping -> getEntityManagerName ( ) . '_metadata_driver' ) ; $ container -> setParameter ( 'doctrine.orm.metadata.driver_chain.class' , 'Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain' ) ; $ chainDriverDefinition -> addMethodCall ( 'addDriver' , [ new Reference ( 'doctrine.orm.' . $ entityMapping -> getUniqueIdentifier ( ) . '_metadata_driver' ) , $ entityMapping -> getEntityNamespace ( ) , ] ) ; }
Register and override the DriverChain definition.

@param ContainerBuilder $container
@param EntityMapping    $entityMapping

@throws EntityManagerNotFoundException Entity Manager nod found
Register and override the DriverChain definition .