QueryDoctrineODMCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 18
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 8 1
A execute() 0 6 1
1
<?php
2
3
/*
4
 * This file is part of the Doctrine MongoDBBundle
5
 *
6
 * The code was originally distributed inside the Symfony framework.
7
 *
8
 * (c) Fabien Potencier <[email protected]>
9
 * (c) Doctrine Project
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\DoctrineMongodbOdmCommands\Command;
16
17
use Doctrine\ODM\MongoDB\Tools\Console\Command\QueryCommand;
18
use Symfony\Component\Console\Input\InputInterface;
19
use Symfony\Component\Console\Input\InputOption;
20
use Symfony\Component\Console\Output\OutputInterface;
21
22
/**
23
 * Execute a Doctrine MongoDB ODM query and output the results.
24
 *
25
 * @author Fabien Potencier <[email protected]>
26
 * @author Jonathan H. Wage <[email protected]>
27
 */
28
class QueryDoctrineODMCommand extends QueryCommand
29
{
30
    protected function configure()
31
    {
32
        parent::configure();
33
34
        $this
35
            ->setName('doctrine:mongodb:query')
36
            ->addOption('dm', null, InputOption::VALUE_OPTIONAL, 'The document manager to use for this command.');
37
    }
38
39
    protected function execute(InputInterface $input, OutputInterface $output)
40
    {
41
        DoctrineCommandHelper::setApplicationDocumentManager($this->getApplication(), $input->getOption('dm'));
42
43
        return parent::execute($input, $output);
44
    }
45
}
46