Skip to content

Commit

Permalink
Merge pull request #10813 from Greg0/fix-primary-id-mapping-xml-driver
Browse files Browse the repository at this point in the history
  • Loading branch information
greg0ire authored Jul 6, 2023
2 parents d6f4834 + 075824f commit 514f6b8
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -376,30 +376,8 @@ public function loadMetadataForClass($className, PersistenceClassMetadata $metad
continue;
}

$mapping = [
'id' => true,
'fieldName' => (string) $idElement['name'],
];

if (isset($idElement['type'])) {
$mapping['type'] = (string) $idElement['type'];
}

if (isset($idElement['length'])) {
$mapping['length'] = (int) $idElement['length'];
}

if (isset($idElement['column'])) {
$mapping['columnName'] = (string) $idElement['column'];
}

if (isset($idElement['column-definition'])) {
$mapping['columnDefinition'] = (string) $idElement['column-definition'];
}

if (isset($idElement->options)) {
$mapping['options'] = $this->parseOptions($idElement->options->children());
}
$mapping = $this->columnToArray($idElement);
$mapping['id'] = true;

$metadata->mapField($mapping);

Expand Down

0 comments on commit 514f6b8

Please sign in to comment.