/** * {@inheritDoc} */ public function setApplication(Application $application = null) { parent::setApplication($application); if ($application && $application instanceof \Symfony\Bundle\FrameworkBundle\Console\Application) { if (!($helperSet = $this->getHelperSet())) { $this->setHelperSet(new HelperSet()); } $helperSet->set(new ConnectionHelper($application->getKernel()->getContainer()->get('doctrine.orm.entity_manager')->getConnection()), 'db'); } }
/** * {@inheritDoc} */ protected function execute(InputInterface $input, OutputInterface $output) { DoctrineCommandHelper::setApplicationConnection($this->getApplication(), $input->getOption('connection')); return parent::execute($input, $output); }
/** * @see Console\Command\Command */ protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output) { $this->getApplication()->getProject()->getDatabase(); parent::execute($input, $output); }