From 86c3744b8c2b2a85d7c33000ab200e7d99adb577 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sun, 5 Jun 2011 08:03:41 +0200 Subject: [PATCH] Made orm:convert-mapping command more configurable (allow to change the extension of the generated files for instance) --- .../Tools/Console/Command/ConvertMappingCommand.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php index 8c1a8fea1b6..1522277fc86 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php @@ -137,8 +137,7 @@ protected function execute(Console\Input\InputInterface $input, Console\Output\O $toType = strtolower($input->getArgument('to-type')); - $cme = new ClassMetadataExporter(); - $exporter = $cme->getExporter($toType, $destPath); + $exporter = $this->getExporter($toType, $destPath); $exporter->setOverwriteExistingFiles( ($input->getOption('force') !== false) ); if ($toType == 'annotation') { @@ -167,4 +166,11 @@ protected function execute(Console\Input\InputInterface $input, Console\Output\O $output->write('No Metadata Classes to process.' . PHP_EOL); } } + + protected function getExporter($toType, $destPath) + { + $cme = new ClassMetadataExporter(); + + return $cme->getExporter($toType, $destPath); + } }