diff --git a/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php index a8fcac3c8..9e20fdc24 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php @@ -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(<<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);