@@ 27-56 (lines=30) @@ | ||
24 | /** |
|
25 | * @see Command |
|
26 | */ |
|
27 | protected function configure() |
|
28 | { |
|
29 | $this |
|
30 | ->setDefinition( |
|
31 | array(new InputOption('namespace', '', InputOption::VALUE_REQUIRED, 'The namespace of the bundle to create'), |
|
32 | new InputOption('dir', '', InputOption::VALUE_REQUIRED, 'The directory where to create the bundle'), |
|
33 | new InputOption('bundle-name', '', InputOption::VALUE_REQUIRED, 'The optional bundle name'), )) |
|
34 | ->setHelp( |
|
35 | <<<'EOT' |
|
36 | The <info>generate:bundle</info> command helps you generates new bundles. |
|
37 | ||
38 | By default, the command interacts with the developer to tweak the generation. |
|
39 | Any passed option will be used as a default value for the interaction |
|
40 | (<comment>--namespace</comment> is the only one needed if you follow the |
|
41 | conventions): |
|
42 | ||
43 | <info>php bin/console kuma:generate:bundle --namespace=Acme/BlogBundle</info> |
|
44 | ||
45 | Note that you can use <comment>/</comment> instead of <comment>\</comment> for the namespace delimiter to avoid any |
|
46 | problem. |
|
47 | ||
48 | If you want to disable any user interaction, use <comment>--no-interaction</comment> but don't forget to pass all needed options: |
|
49 | ||
50 | <info>php bin/console kuma:generate:bundle --namespace=Acme/BlogBundle --dir=src [--bundle-name=...] --no-interaction</info> |
|
51 | ||
52 | Note that the bundle namespace must end with "Bundle". |
|
53 | EOT |
|
54 | ) |
|
55 | ->setName('kuma:generate:bundle'); |
|
56 | } |
|
57 | ||
58 | /** |
|
59 | * Executes the command. |
@@ 23-49 (lines=27) @@ | ||
20 | /** |
|
21 | * @see Command |
|
22 | */ |
|
23 | protected function configure() |
|
24 | { |
|
25 | $this |
|
26 | ->setDefinition( |
|
27 | array( |
|
28 | new InputOption('namespace', '', InputOption::VALUE_REQUIRED, 'The namespace to generate the SearchPage in. This option is deprecated when using this bundle with symfony 4.'), |
|
29 | new InputOption('prefix', '', InputOption::VALUE_OPTIONAL, 'The prefix to be used in the table names of the generated entities'), |
|
30 | new InputOption('createpage', null, InputOption::VALUE_NONE, 'If set, the task will generate data fixtures to populate your database with a search page'), |
|
31 | ) |
|
32 | ) |
|
33 | ->setDescription('Generates a SearchPage based on KunstmaanNodeSearchBundle') |
|
34 | ->setHelp(<<<'EOT' |
|
35 | The <info>kuma:generate:searchpage</info> command generates a SearchPage using the KunstmaanNodeSearchBundle and KunstmaanSearchBundle |
|
36 | ||
37 | <info>php bin/console kuma:generate:searchpage --namespace=Namespace/NamedBundle</info> |
|
38 | ||
39 | Use the <info>--prefix</info> option to add a prefix to the table names of the generated entities |
|
40 | ||
41 | <info>php bin/console kuma:generate:searchpage --namespace=Namespace/NamedBundle --prefix=demo_</info> |
|
42 | ||
43 | Add the <info>--createpage</info> option to create data fixtures to populate your database with a search page |
|
44 | ||
45 | <info>php bin/console kuma:generate:article --namespace=Namespace/NamedBundle --createpage</info> |
|
46 | EOT |
|
47 | ) |
|
48 | ->setName('kuma:generate:searchpage'); |
|
49 | } |
|
50 | ||
51 | /** |
|
52 | * Executes the command. |