From 0877ecbe56c728aa307ee2b878d024ebec101f2c Mon Sep 17 00:00:00 2001 From: Grzegorz K <1397756+Greg0@users.noreply.github.com> Date: Mon, 3 Jul 2023 15:15:08 +0200 Subject: [PATCH 1/2] Treat id field proprites same as regular field --- lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php | 26 ++----------------- 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php b/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php index 47a70d62c39..898d86f32bc 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php @@ -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); From 075824f5b5b7fe6b1652baa336bc0bf8f9da096a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20Ku=C5=BAnik?= Date: Wed, 5 Jul 2023 21:10:48 +0200 Subject: [PATCH 2/2] Fix code style issues --- lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php b/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php index 898d86f32bc..abd94fd01e3 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php @@ -376,7 +376,7 @@ public function loadMetadataForClass($className, PersistenceClassMetadata $metad continue; } - $mapping = $this->columnToArray($idElement); + $mapping = $this->columnToArray($idElement); $mapping['id'] = true; $metadata->mapField($mapping);