src/DoctrineORMModule/Module.php
public function init(ModuleManagerInterface $manager)
    {
        // Initialize the console
        $manager
            ->getEventManager()
            ->getSharedManager()
            ->attach(
                'doctrine',
                'loadCli.post',
                function (EventInterface $event) {
                    $event
                        ->getParam('ServiceManager')
                        ->get(CliConfigurator::class)
                        ->configure($event->getTarget())
                        ;
                },
                1
            );

        // Initialize logger collector in ZendDeveloperTools
        if (class_exists(ProfilerEvent::class)) {
            $manager
                ->getEventManager()
                ->attach(
                    ProfilerEvent::EVENT_PROFILER_INIT,
                    function ($event) {
                        $container = $event->getTarget()->getParam('ServiceManager');
                        $container->get('doctrine.sql_logger_collector.orm_default');
                    }
                );
        }
    }
public function init(ModuleManagerInterface $manager)
    {
        // Initialize the console
        $manager
            ->getEventManager()
            ->getSharedManager()
            ->attach(
                'doctrine',
                'loadCli.post',
                function (EventInterface $event) {
                    $event
                        ->getParam('ServiceManager')
                        ->get(CliConfigurator::class)
                        ->configure($event->getTarget())
                        ;
                },
                1
            );

        // Initialize logger collector in ZendDeveloperTools
        if (class_exists(ProfilerEvent::class)) {
            $manager
                ->getEventManager()
                ->attach(
                    ProfilerEvent::EVENT_PROFILER_INIT,
                    function ($event) {
                        $container = $event->getTarget()->getParam('ServiceManager');
                        $container->get('doctrine.sql_logger_collector.orm_default');
                    }
                );
        }
    }
{@inheritDoc}