Skip to content
Browse files

[DDC-1798] Exporter generate error when composite primary key is gene…

…rated. Fixes GH-342
  • Loading branch information...
1 parent 47ac61b commit 04b23dbf100ceb5401f3bc83e689535905ef9dd3 @beberlei beberlei committed
View
2 lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php
@@ -92,7 +92,7 @@ public function exportClassMetadata(ClassMetadataInfo $metadata)
$lines[] = '$metadata->mapField(' . $this->_varExport($fieldMapping) . ');';
}
- if ($generatorType = $this->_getIdGeneratorTypeString($metadata->generatorType)) {
+ if ( ! $metadata->isIdentifierComposite && $generatorType = $this->_getIdGeneratorTypeString($metadata->generatorType)) {
$lines[] = '$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_' . $generatorType . ');';
}
View
2 lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php
@@ -130,7 +130,7 @@ public function exportClassMetadata(ClassMetadataInfo $metadata)
}
}
- if ($idGeneratorType = $this->_getIdGeneratorTypeString($metadata->generatorType)) {
+ if ( ! $metadata->isIdentifierComposite && $idGeneratorType = $this->_getIdGeneratorTypeString($metadata->generatorType)) {
$id[$metadata->getSingleIdentifierFieldName()]['generator']['strategy'] = $idGeneratorType;
}
View
2 lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php
@@ -114,7 +114,7 @@ public function exportClassMetadata(ClassMetadataInfo $metadata)
$fieldMappings[$name] = $fieldMapping;
}
- if ($idGeneratorType = $this->_getIdGeneratorTypeString($metadata->generatorType)) {
+ if ( ! $metadata->isIdentifierComposite && $idGeneratorType = $this->_getIdGeneratorTypeString($metadata->generatorType)) {
$ids[$metadata->getSingleIdentifierFieldName()]['generator']['strategy'] = $idGeneratorType;
}

0 comments on commit 04b23db

Please sign in to comment.
Something went wrong with that request. Please try again.