private function disableDoctrineListener(ContainerBuilder $container)
    {
        if (!$container->hasParameter('kernel.bundles')) {
            return;
        }
        $bundles = $container->getParameter('kernel.bundles');
        if (!isset($bundles['DoctrineBundle'])) {
            $container->prependExtensionConfig($this->getAlias(), array(
                'listeners' => array(
                    'clear_entity_managers' => false
                )
            ));
        }
    }
private function disableDoctrineListener(ContainerBuilder $container)
    {
        if (!$container->hasParameter('kernel.bundles')) {
            return;
        }
        $bundles = $container->getParameter('kernel.bundles');
        if (!isset($bundles['DoctrineBundle'])) {
            $container->prependExtensionConfig($this->getAlias(), array(
                'listeners' => array(
                    'clear_entity_managers' => false
                )
            ));
        }
    }
private function disableDoctrineListener ( ContainerBuilder $ container ) { if ( ! $ container -> hasParameter ( 'kernel.bundles' ) ) { return ; } $ bundles = $ container -> getParameter ( 'kernel.bundles' ) ; if ( ! isset ( $ bundles [ 'DoctrineBundle' ] ) ) { $ container -> prependExtensionConfig ( $ this -> getAlias ( ) , array ( 'listeners' => array ( 'clear_entity_managers' => false ) ) ) ; } }
Disable clear entity managers listener, if no doctrine bundle is installed.

@param ContainerBuilder $container
@return void
Disable clear entity managers listener if no doctrine bundle is installed .