CreateSchemaDoctrineCommand::execute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
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\CreateCommand;
21
22
/**
23
 * Command to execute the SQL needed to generate the database schema for
24
 * a given entity manager.
25
 *
26
 * @author Fabien Potencier <[email protected]>
27
 * @author Jonathan H. Wage <[email protected]>
28
 */
29
class CreateSchemaDoctrineCommand extends CreateCommand
30
{
31
    /**
32
     * {@inheritDoc}
33
     */
34
    protected function configure()
35
    {
36
        parent::configure();
37
38
        $this
39
            ->setName('doctrine:schema:create')
40
            ->setDescription('Executes (or dumps) the SQL needed to generate the database schema')
41
            ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command');
42
    }
43
44
    /**
45
     * {@inheritDoc}
46
     */
47
    protected function execute(InputInterface $input, OutputInterface $output)
48
    {
49
        DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em'));
50
51
        parent::execute($input, $output);
52
    }
53
}
54