[PR #1006] [MERGED] Handling invalid discriminator values #9023

Open
opened 2026-01-22 16:02:50 +01:00 by admin · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/doctrine/orm/pull/1006
Author: @Trainmaster
Created: 4/9/2014
Status: Merged
Merged: 4/15/2014
Merged by: @guilhermeblanco

Base: masterHead: master


📝 Commits (5)

  • f7b95c1 Add: invalidDiscriminatorValue method
  • d1c722c Fix: handle invalid discriminator value
  • a054b59 [DDC-3076] Add test
  • df020e0 [DDC-3076] Fix ObjectHydrator
  • 8740d54 [DDC-3076] Add/Improve tests

📊 Changes

5 files changed (+88 additions, -2 deletions)

View changed files

📝 lib/Doctrine/ORM/Internal/Hydration/HydrationException.php (+14 -0)
📝 lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php (+7 -1)
📝 lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php (+7 -1)
📝 tests/Doctrine/Tests/ORM/Hydration/ObjectHydratorTest.php (+30 -0)
📝 tests/Doctrine/Tests/ORM/Hydration/SimpleObjectHydratorTest.php (+30 -0)

📄 Description

Two scenarios:

  • The DiscriminatorMap is specified via metadata. In case the entity's discriminator value is not matching with a value of the DiscriminatorMap it will result in a Notice: Undefined index ... on line 102 and exception 'Doctrine\Common\Persistence\Mapping\MappingException' with message 'Class '' does not exist' in. The proposed changes deal with this.
  • The DiscriminatorMap is automatically generated. The discriminator value may no longer be invalid if there's just metadata missing for the automatically generated class names. I'm not sure how to deal with that properly.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/doctrine/orm/pull/1006 **Author:** [@Trainmaster](https://github.com/Trainmaster) **Created:** 4/9/2014 **Status:** ✅ Merged **Merged:** 4/15/2014 **Merged by:** [@guilhermeblanco](https://github.com/guilhermeblanco) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (5) - [`f7b95c1`](https://github.com/doctrine/orm/commit/f7b95c1aa5ea3436aff1e2281db39beb85914ce7) Add: invalidDiscriminatorValue method - [`d1c722c`](https://github.com/doctrine/orm/commit/d1c722c1d0f537aa832ba21637e8a7494a1aa491) Fix: handle invalid discriminator value - [`a054b59`](https://github.com/doctrine/orm/commit/a054b595509b6a01fdd74da086148849f022314b) [DDC-3076] Add test - [`df020e0`](https://github.com/doctrine/orm/commit/df020e08a0f55edc3a13a38f749b3e2be84ca5a6) [DDC-3076] Fix ObjectHydrator - [`8740d54`](https://github.com/doctrine/orm/commit/8740d54210329a139399d2b99462d5788952050e) [DDC-3076] Add/Improve tests ### 📊 Changes **5 files changed** (+88 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `lib/Doctrine/ORM/Internal/Hydration/HydrationException.php` (+14 -0) 📝 `lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php` (+7 -1) 📝 `lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php` (+7 -1) 📝 `tests/Doctrine/Tests/ORM/Hydration/ObjectHydratorTest.php` (+30 -0) 📝 `tests/Doctrine/Tests/ORM/Hydration/SimpleObjectHydratorTest.php` (+30 -0) </details> ### 📄 Description Two scenarios: - **The DiscriminatorMap is specified via metadata**. In case the entity's discriminator value is not matching with a value of the DiscriminatorMap it will result in a `Notice: Undefined index ... on line 102` and `exception 'Doctrine\Common\Persistence\Mapping\MappingException' with message 'Class '' does not exist' in`. The proposed changes deal with this. - **The DiscriminatorMap is automatically generated**. The discriminator value may no longer be invalid if there's just metadata missing for the automatically generated class names. I'm not sure how to deal with that properly. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
admin added the pull-request label 2026-01-22 16:02:50 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#9023