ConnectionHelper example

$this->registerTaggedServiceIds();

        if (!$this->skipDatabase) {
            // Wrap database related logic in a try-catch             // so that non-db commands can still execute             try {
                $em = $this->kernel->getContainer()->get(ModelManager::class);

                // Setup doctrine commands                 $helperSet = $this->getHelperSet();
                $helperSet->set(new EntityManagerHelper($em), 'em');
                $helperSet->set(new ConnectionHelper($em->getConnection()), 'db');

                DoctrineConsoleRunner::addCommands($this);

                $this->registerEventCommands();

                foreach ($this->kernel->getPlugins() as $plugin) {
                    if ($plugin->isActive()) {
                        $plugin->registerCommands($this);
                    }
                }
            } catch (Exception $e) {
                
Home | Imprint | This part of the site doesn't use cookies.