Skip to content

Commit

Permalink
Made orm:convert-mapping command more configurable (allow to change t…
Browse files Browse the repository at this point in the history
…he extension of the generated files for instance)
  • Loading branch information
fabpot authored and beberlei committed Jun 5, 2011
1 parent 875f5c1 commit 86c3744
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php
Expand Up @@ -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') {
Expand Down Expand Up @@ -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);
}
}

0 comments on commit 86c3744

Please sign in to comment.