/
MigrationsVersionDoctrineCommand.php
46 lines (39 loc) · 1.42 KB
/
MigrationsVersionDoctrineCommand.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
namespace Symfony\Framework\DoctrineBundle\Command;
use Symfony\Components\Console\Input\InputInterface;
use Symfony\Components\Console\Output\OutputInterface;
use Symfony\Components\Console\Input\InputOption;
use DoctrineExtensions\Migrations\Tools\Console\Command\VersionCommand;
/*
* This file is part of the Symfony framework.
*
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
/**
* Command for manually adding and deleting migration versions from the version table.
*
* @package Symfony
* @subpackage Framework_DoctrineBundle
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
* @author Jonathan H. Wage <jonwage@gmail.com>
*/
class MigrationsVersionDoctrineCommand extends VersionCommand
{
protected function configure()
{
parent::configure();
$this
->setName('doctrine:migrations:version')
->addOption('bundle', null, InputOption::PARAMETER_REQUIRED, 'The bundle to load migrations configuration from.')
->addOption('em', null, InputOption::PARAMETER_OPTIONAL, 'The entity manager to use for this command.')
;
}
public function execute(InputInterface $input, OutputInterface $output)
{
DoctrineCommand::setApplicationEntityManager($this->application, $input->getOption('em'));
parent::execute($input, $output);
}
}