1
0
mirror of synced 2025-01-09 18:47:10 +03:00

Merge pull request #833 from ronanguilloux/patch-console-entity-generator

Generate-Entities-Console-Command: Adding an 'avoid backup' flag
This commit is contained in:
Benjamin Eberlei 2014-01-02 14:13:27 -08:00
commit 41581847b2

View File

@ -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(
'no-backup', 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('no-backup'));
if (($extend = $input->getOption('extend')) !== null) { if (($extend = $input->getOption('extend')) !== null) {
$entityGenerator->setClassToExtend($extend); $entityGenerator->setClassToExtend($extend);