Conditions | 1 |
Paths | 1 |
Total Lines | 25 |
Lines | 25 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
18 | protected function configure() |
||
19 | { |
||
20 | parent::configure(); |
||
21 | |||
22 | $this |
||
23 | ->setName('doctrine:query:dql') |
||
24 | ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command') |
||
25 | ->setHelp(<<<EOT |
||
26 | The <info>%command.name%</info> command executes the given DQL query and |
||
27 | outputs the results: |
||
28 | |||
29 | <info>php %command.full_name% "SELECT u FROM UserBundle:User u"</info> |
||
30 | |||
31 | You can also optional specify some additional options like what type of |
||
32 | hydration to use when executing the query: |
||
33 | |||
34 | <info>php %command.full_name% "SELECT u FROM UserBundle:User u" --hydrate=array</info> |
||
35 | |||
36 | Additionally you can specify the first result and maximum amount of results to |
||
37 | show: |
||
38 | |||
39 | <info>php %command.full_name% "SELECT u FROM UserBundle:User u" --first-result=0 --max-result=30</info> |
||
40 | EOT |
||
41 | ); |
||
42 | } |
||
43 | |||
54 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.