| 132 | | if ($this->_isDoctrine1Schema($from)) { |
| 133 | | $printer->writeln('Converting Doctrine 1 schema to Doctrine 2 mapping files', 'INFO'); |
| 134 | | |
| 135 | | $converter = new \Doctrine\ORM\Tools\ConvertDoctrine1Schema($from); |
| 136 | | $metadatas = $converter->getMetadatasFromSchema(); |
| 137 | | } else { |
| 138 | | foreach ($from as $source) { |
| 139 | | $sourceArg = $source; |
| 140 | | $type = $this->_determineSourceType($sourceArg); |
| 141 | | |
| 142 | | if ( ! $type) { |
| 143 | | throw new CliException( |
| 144 | | "Invalid mapping source type '$sourceArg'." |
| 145 | | ); |
| 146 | | } |
| 147 | | |
| 148 | | $source = $this->_getSourceByType($type, $sourceArg); |
| 149 | | |
| 150 | | $printer->writeln( |
| 151 | | sprintf( |
| 152 | | 'Adding "%s" mapping source which contains the "%s" format', |
| 153 | | $printer->format($sourceArg, 'KEYWORD'), $printer->format($type, 'KEYWORD') |
| 154 | | ) |
| | 132 | foreach ($from as $source) { |
| | 133 | $sourceArg = $source; |
| | 134 | $type = $this->_determineSourceType($sourceArg); |
| | 135 | |
| | 136 | if ( ! $type) { |
| | 137 | throw new CliException( |
| | 138 | "Invalid mapping source type '$sourceArg'." |
| 156 | | |
| 157 | | $cme->addMappingSource($source, $type); |
| 158 | | } |
| 159 | | |
| 160 | | $metadatas = $cme->getMetadatasForMappingSources(); |
| 161 | | } |
| | 140 | } |
| | 141 | |
| | 142 | $source = $this->_getSourceByType($type, $sourceArg); |
| | 143 | |
| | 144 | $printer->writeln( |
| | 145 | sprintf( |
| | 146 | 'Adding "%s" mapping source which contains the "%s" format', |
| | 147 | $printer->format($sourceArg, 'KEYWORD'), $printer->format($type, 'KEYWORD') |
| | 148 | ) |
| | 149 | ); |
| | 150 | |
| | 151 | $cme->addMappingSource($source, $type); |
| | 152 | } |
| | 153 | |
| | 154 | $metadatas = $cme->getMetadatasForMappingSources(); |