/** * @see Command * * @throws \InvalidArgumentException When the target directory does not exist */ protected function execute(InputInterface $input, OutputInterface $output) { if (!$input->getOption('sql')) { $output->writeln('<info>Building model classes</info>'); $modelCommand = new BuildModelCommand(); $modelCommand->setApplication($this->application); $modelCommand->execute($input, $output); } if (!$input->getOption('classes')) { $output->writeln('<info>Building model sql</info>'); $sqlCommand = new BuildSQLCommand(); $sqlCommand->setApplication($this->application); $sqlCommand->execute($input, $output); } }
/** * @see Command * * @throws \InvalidArgumentException When the target directory does not exist */ protected function execute(InputInterface $input, OutputInterface $output) { if (!$input->getOption('sql')) { $modelCommand = new BuildModelCommand(); $modelCommand->setApplication($this->getApplication()); $modelCommand->execute($input, $output); } if (!$input->getOption('classes')) { $sqlCommand = new BuildSQLCommand(); $sqlCommand->setApplication($this->getApplication()); $sqlCommand->execute($input, $output); } if ($input->getOption('insert-sql')) { $insertCommand = new InsertSqlCommand(); $insertCommand->setApplication($this->getApplication()); // By-pass the '--force' required option $this->addOption('force', '', InputOption::VALUE_NONE, ''); $input->setOption('force', true); $insertCommand->execute($input, $output); } }