protected function bootExtensionManager()
    {
        $manager = $this->app->make(ExtensionManager::class);

        if ($manager->needsBooting()) {
            $this->app['events']->dispatch('doctrine.extensions.booting');

            $this->app->make(ExtensionManager::class)->boot(
                $this->app['registry']
            );

            $this->app['events']->dispatch('doctrine.extensions.booted');
        }
    }