/**
  * Export
  *
  * @param OutputInterface $output
  */
 public function export(OutputInterface $output)
 {
     $output->writeln(sprintf('Exporting "<info>%s</info>" schema', $this->getName()));
     $outputEntityDir = $this->getOutpuEntitytDir();
     $this->console->run(new ArrayInput(['command' => 'mkdir', 'path' => $outputEntityDir]));
     $outputModelDir = $this->getOutpuModeltDir();
     $this->console->run(new ArrayInput(['command' => 'rm', 'path' => $outputModelDir]));
     $configDoctrineDir = $this->getOutpuConfigDir() . '/doctrine';
     $configDoctrineXmlDir = $configDoctrineDir . '-xml';
     $this->console->run(new ArrayInput(['command' => 'rm', 'path' => $configDoctrineXmlDir]));
     $bootstrap = new Bootstrap();
     // define a formatter and do configuration
     $formatter = $bootstrap->getFormatter($this->getOption('formatter'));
     $formatter->setup($this->getFormatterParams());
     // load document and export
     $output->writeln(sprintf('Create Entities'));
     $document = $bootstrap->export($formatter, $this->getMwbFile(), $this->getOutpuModeltDir());
     $bootstrap->preCompileModels($formatter, $document);
     $options = ['command' => 'doctrine:mapping:convert', 'to-type' => 'xml', 'dest-path' => $configDoctrineXmlDir];
     $this->console->run(new ArrayInput($options), $output);
     $output->writeln(sprintf('export model meta to <info>%s</info>', $configDoctrineXmlDir));
     $bootstrap->postCompileModels($formatter, $document);
 }
 /**
  * Export.
  *
  * @param OutputInterface $output
  */
 public function export(OutputInterface $output)
 {
     $output->writeln(sprintf('Exporting "<info>%s</info>" schema', $this->getName()));
     $bootstrap = new Bootstrap();
     // define a formatter and do configuration
     $formatter = $bootstrap->getFormatter($this->getOption('formatter'));
     $formatter->setup($this->getFormatterParams());
     // load document and export
     $output->writeln(sprintf('Create Entities'));
     $document = $bootstrap->export($formatter, $this->getMwbFile(), $this->getOutpuModeltDir());
     $workDir = $document->getWriter()->getStorage()->getResult();
     $dirs = $bootstrap->preCompileModels($formatter, $workDir);
     foreach ($dirs as $workDir) {
         $destPath = dirname($workDir) . '/Resources/config/doctrine-xml';
         $options = ['command' => 'doctrine:mapping:convert', 'to-type' => 'xml', 'dest-path' => $destPath];
         if (preg_match('/([^\\/]*?)(\\/)([^\\/]*?Bundle)/', $workDir, $m)) {
             $options['--filter'] = $m[1];
         }
         $this->console->run(new ArrayInput($options), $output);
         $output->writeln(sprintf('export model meta to <info>%s</info>' . "\n----\n", $destPath));
         $bootstrap->postCompileModels($formatter, $workDir . '/Model');
     }
 }