示例#1
0
 /**
  * {@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');
     }
 }
示例#2
0
 /**
  * {@inheritDoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     DoctrineCommandHelper::setApplicationConnection($this->getApplication(), $input->getOption('connection'));
     return parent::execute($input, $output);
 }
示例#3
0
 /**
  * @see Console\Command\Command
  */
 protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output)
 {
     $this->getApplication()->getProject()->getDatabase();
     parent::execute($input, $output);
 }