Started to work on Propel2 commands integration (only a few work at the moment)
This commit is contained in:
parent
313057ca5a
commit
38e7f63a62
9 changed files with 824 additions and 0 deletions
48
Command/SqlInsertCommand.php
Normal file
48
Command/SqlInsertCommand.php
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<?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;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
/**
|
||||
* @author Kévin Gomez <contact@kevingomez.fr>
|
||||
*/
|
||||
class SqlInsertCommand extends AbstractCommand
|
||||
{
|
||||
/**
|
||||
* {@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}
|
||||
*/
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$this->setupBuildTimeFiles();
|
||||
|
||||
$params = array(
|
||||
'--connection' => $this->getConnections($input->getOption('connection')),
|
||||
);
|
||||
$command = new \Propel\Generator\Command\SqlInsertCommand();
|
||||
|
||||
return $this->runCommand($command, $params, $input, $output);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue