From 5c01e8e99ede01bae5028a64b23ed670a9d569c1 Mon Sep 17 00:00:00 2001 From: Ronan Guilloux Date: Thu, 31 Oct 2013 12:00:32 +0100 Subject: [PATCH 1/2] 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); From 48d078a85674e53c6aa78a458a9c953498825f8c Mon Sep 17 00:00:00 2001 From: Ronan Guilloux Date: Thu, 31 Oct 2013 12:25:43 +0100 Subject: [PATCH 2/2] no-backup instead of nobackup --- .../ORM/Tools/Console/Command/GenerateEntitiesCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php index 9e20fdc24..61d226999 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php @@ -82,7 +82,7 @@ class GenerateEntitiesCommand extends Command 'Defines the number of indentation spaces', 4 ), new InputOption( - 'nobackup', null, InputOption::VALUE_NONE, + 'no-backup', null, InputOption::VALUE_NONE, 'Flag to define if generator should avoid backuping existing entity file if it exists.' ) )) @@ -145,7 +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')); + $entityGenerator->setBackupExisting(!$input->getOption('no-backup')); if (($extend = $input->getOption('extend')) !== null) { $entityGenerator->setClassToExtend($extend);