protected function execute(InputInterface $input, OutputInterface $output) { $this->initDoctrine($input, $output); if ($this->transactional) { $this->em->getConnection()->beginTransaction(); } try { $ret = parent::execute($input, $output); if ($ret <= 0) { if ($this->echoLog) { DoctrineHelper::enableSQLLogging('echo', $this->em); } if ($input->getOption('dry-run')) { $this->warn('DryRun: nothing is flushed'); } else { $this->em->flush(); } if ($this->transactional) { $this->em->getConnection()->commit(); } } else { if ($this->transactional) { $this->em->getConnection()->rollback(); } } } catch (\Exception $e) { if ($this->transactional) { $this->em->getConnection()->rollback(); } $this->em->close(); throw $e; } return $ret; }
protected function execute(InputInterface $input, OutputInterface $output) { $this->execInput = $input; $output->writeln('Start Compiling file: ' . $this->getInFile()); parent::execute($input, $output); $output->writeln('finished.'); }
public function configure() { parent::configure(); $configure = $this->configure; $definition = $configure($this); if (is_array($definition)) { $this->setDefinition($definition); } }