public function execute(InputInterface $input, OutputInterface $output)
 {
     DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em'));
     $configuration = $this->getMigrationConfiguration($input, $output);
     DoctrineCommand::configureMigrations($this->getApplication()->getKernel()->getContainer(), $configuration);
     parent::execute($input, $output);
 }
 /**
  * {@inheritdoc}
  */
 public function execute(InputInterface $input, OutputInterface $output)
 {
     /** @var Application $application */
     $application = $this->getApplication();
     DoctrineCommandHelper::setApplicationConnection($application, $input->getOption('db-configuration'));
     DoctrineCommand::configureMigrations($application->getKernel()->getContainer(), $this->getMigrationConfiguration($input, $output));
     parent::execute($input, $output);
 }
 public function execute(InputInterface $input, OutputInterface $output)
 {
     // EM and DB options cannot be set at same time
     if (null !== $input->getOption('em') && null !== $input->getOption('db')) {
         throw new \InvalidArgumentException('Cannot set both "em" and "db" for command execution.');
     }
     Helper\DoctrineCommandHelper::setApplicationHelper($this->getApplication(), $input);
     $configuration = $this->getMigrationConfiguration($input, $output);
     DoctrineCommand::configureMigrations($this->getApplication()->getKernel()->getContainer(), $configuration);
     parent::execute($input, $output);
 }
 public function execute(InputInterface $input, OutputInterface $output)
 {
     DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em'));
     if ($input->getOption('shard')) {
         $connection = $this->getApplication()->getHelperSet()->get('db')->getConnection();
         if (!$connection instanceof PoolingShardConnection) {
             throw new \LogicException(sprintf("Connection of EntityManager '%s' must implements shards configuration.", $input->getOption('em')));
         }
         $connection->connect($input->getOption('shard'));
     }
     $configuration = $this->getMigrationConfiguration($input, $output);
     DoctrineCommand::configureMigrations($this->getApplication()->getKernel()->getContainer(), $configuration);
     parent::execute($input, $output);
 }
 protected function getMigrationConfiguration()
 {
     $config = new Configuration($this->get("doctrine.dbal.default_connection"));
     DoctrineCommand::configureMigrations($this->container, $config);
     return $config;
 }
 /**
  * @return string[]
  */
 private function findNewMigration()
 {
     $this->doctrineMigrationConfiguration = null;
     DoctrineCommand::configureMigrations($this->getContainer(), $this->getDMC());
     return array_keys($this->getDMC()->getMigrationsToExecute('up', $this->getDMC()->getLatestVersion()));
 }