DropSchemaDoctrineCommand::configure()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Doctrine Bundle
5
 *
6
 * The code was originally distributed inside the Symfony framework.
7
 *
8
 * (c) Fabien Potencier <[email protected]>
9
 * (c) Doctrine Project, Benjamin Eberlei <[email protected]>
10
 *
11
 * For the full copyright and license information, please view the LICENSE
12
 * file that was distributed with this source code.
13
 */
14
15
namespace Saxulum\DoctrineOrmCommands\Command\Proxy;
16
17
use Symfony\Component\Console\Input\InputOption;
18
use Symfony\Component\Console\Input\InputInterface;
19
use Symfony\Component\Console\Output\OutputInterface;
20
use Doctrine\ORM\Tools\Console\Command\SchemaTool\DropCommand;
21
22
/**
23
 * Command to drop the database schema for a set of classes based on their mappings.
24
 *
25
 * @author Fabien Potencier <[email protected]>
26
 * @author Jonathan H. Wage <[email protected]>
27
 */
28
class DropSchemaDoctrineCommand extends DropCommand
29
{
30
    /**
31
     * {@inheritDoc}
32
     */
33
    protected function configure()
34
    {
35
        parent::configure();
36
37
        $this
38
            ->setName('doctrine:schema:drop')
39
            ->setDescription('Executes (or dumps) the SQL needed to drop the current database schema')
40
            ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command');
41
    }
42
43
    /**
44
     * {@inheritDoc}
45
     */
46
    protected function execute(InputInterface $input, OutputInterface $output)
47
    {
48
        DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em'));
49
50
        parent::execute($input, $output);
51
    }
52
}
53