From 5c01e8e99ede01bae5028a64b23ed670a9d569c1 Mon Sep 17 00:00:00 2001 From: Ronan Guilloux Date: Thu, 31 Oct 2013 12:00:32 +0100 Subject: [PATCH] Generate-Entities-Console-Command: Adding an 'avoid creating backup files' flag --- .../ORM/Tools/Console/Command/GenerateEntitiesCommand.php | 5 +++++ 1 file changed, 5 insertions(+) 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);