2013-10-15 23:48:33 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This file is part of the PropelBundle package.
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*
|
|
|
|
* @license MIT License
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Propel\PropelBundle\Command;
|
|
|
|
|
|
|
|
use Symfony\Component\Console\Input\InputOption;
|
|
|
|
use Symfony\Component\Console\Input\InputInterface;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Kévin Gomez <contact@kevingomez.fr>
|
|
|
|
*/
|
2013-11-24 17:36:58 +01:00
|
|
|
class SqlInsertCommand extends WrappedCommand
|
2013-10-15 23:48:33 +02:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
protected function configure()
|
|
|
|
{
|
|
|
|
$this
|
|
|
|
->setName('propel:sql:insert')
|
|
|
|
->setDescription('Insert SQL statements')
|
|
|
|
->addOption('connection', null, InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL, 'Connection to use. Example: default, bookstore')
|
|
|
|
;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
2013-10-31 21:39:12 +01:00
|
|
|
protected function createSubCommandInstance()
|
2013-10-15 23:48:33 +02:00
|
|
|
{
|
2013-10-31 21:39:12 +01:00
|
|
|
return new \Propel\Generator\Command\SqlInsertCommand();
|
|
|
|
}
|
2013-10-15 23:48:33 +02:00
|
|
|
|
2013-10-31 21:39:12 +01:00
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
protected function getSubCommandArguments(InputInterface $input)
|
|
|
|
{
|
|
|
|
return array(
|
2014-04-19 05:54:43 +02:00
|
|
|
'--connection' => $this->getConnections($input->getOption('connection')),
|
2014-09-09 22:59:13 +02:00
|
|
|
'--sql-dir' => $this->cacheDir,
|
2013-10-15 23:48:33 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|