1
0
mirror of synced 2025-01-09 02:27:10 +03:00

Generate-Entities-Console-Command: Adding an 'avoid creating backup files' flag

This commit is contained in:
Ronan Guilloux 2013-10-31 12:00:32 +01:00
parent 514dd4e852
commit 5c01e8e99e

View File

@ -80,6 +80,10 @@ class GenerateEntitiesCommand extends Command
new InputOption(
'num-spaces', null, InputOption::VALUE_OPTIONAL,
'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
@ -141,6 +145,7 @@ EOT
$entityGenerator->setRegenerateEntityIfExists($input->getOption('regenerate-entities'));
$entityGenerator->setUpdateEntityIfExists($input->getOption('update-entities'));
$entityGenerator->setNumSpaces($input->getOption('num-spaces'));
$entityGenerator->setBackupExisting(!$input->getOption('nobackup'));
if (($extend = $input->getOption('extend')) !== null) {
$entityGenerator->setClassToExtend($extend);