Generate-Entities-Console-Command: Adding an 'avoid creating backup files' flag
This commit is contained in:
parent
514dd4e852
commit
5c01e8e99e
@ -80,6 +80,10 @@ class GenerateEntitiesCommand extends Command
|
|||||||
new InputOption(
|
new InputOption(
|
||||||
'num-spaces', null, InputOption::VALUE_OPTIONAL,
|
'num-spaces', null, InputOption::VALUE_OPTIONAL,
|
||||||
'Defines the number of indentation spaces', 4
|
'Defines the number of indentation spaces', 4
|
||||||
|
),
|
||||||
|
new InputOption(
|
||||||
|
'nobackup', null, InputOption::VALUE_NONE,
|
||||||
|
'Flag to define if generator should avoid backuping existing entity file if it exists.'
|
||||||
)
|
)
|
||||||
))
|
))
|
||||||
->setHelp(<<<EOT
|
->setHelp(<<<EOT
|
||||||
@ -141,6 +145,7 @@ EOT
|
|||||||
$entityGenerator->setRegenerateEntityIfExists($input->getOption('regenerate-entities'));
|
$entityGenerator->setRegenerateEntityIfExists($input->getOption('regenerate-entities'));
|
||||||
$entityGenerator->setUpdateEntityIfExists($input->getOption('update-entities'));
|
$entityGenerator->setUpdateEntityIfExists($input->getOption('update-entities'));
|
||||||
$entityGenerator->setNumSpaces($input->getOption('num-spaces'));
|
$entityGenerator->setNumSpaces($input->getOption('num-spaces'));
|
||||||
|
$entityGenerator->setBackupExisting(!$input->getOption('nobackup'));
|
||||||
|
|
||||||
if (($extend = $input->getOption('extend')) !== null) {
|
if (($extend = $input->getOption('extend')) !== null) {
|
||||||
$entityGenerator->setClassToExtend($extend);
|
$entityGenerator->setClassToExtend($extend);
|
||||||
|
Loading…
Reference in New Issue
Block a user