From 07530d09ac52a1b6528818f70465895892fb71d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Gomez?= Date: Thu, 31 Oct 2013 21:07:23 +0000 Subject: [PATCH] Implemented the SqlBuild command --- Command/SqlBuildCommand.php | 57 +++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Command/SqlBuildCommand.php diff --git a/Command/SqlBuildCommand.php b/Command/SqlBuildCommand.php new file mode 100644 index 0000000..d73dad3 --- /dev/null +++ b/Command/SqlBuildCommand.php @@ -0,0 +1,57 @@ + + */ +class SqlBuildCommand extends AbstractCommand +{ + /** + * {@inheritdoc} + */ + protected function configure() + { + parent::configure(); + + $this + ->setName('propel:sql:build') + ->setDescription('Build SQL files') + + ->addOption('connection', null, InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL, 'Connection to use. Example: default, bookstore') + // @todo add the other arguments/options handled by the command + ; + } + + /** + * {@inheritdoc} + */ + protected function createSubCommandInstance() + { + return new \Propel\Generator\Command\SqlBuildCommand(); + } + + /** + * {@inheritdoc} + */ + protected function getSubCommandArguments(InputInterface $input) + { + return array( + '--output-dir' => $this->getCacheDir(), + '--connection' => $this->getConnections($input->getOption('connection')), + ); + } +}