[PR #1309] [DDC-3582] Fix hydration of nested embeddables #9370

Closed
opened 2026-01-22 16:04:07 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/1309

State: closed
Merged: No


The wrong class is chosen when hydrating embeddables that are part of a nested structure. See DDC3582Test for a demonstration. The fix is to use class instead of embeddedClass to instantiate the embeddable in ReflectionEmbeddedProperty.

The test I removed from ReflectionEmbeddedPropertyTest was failing because you cannot instantiate an abstract class (and rightfully so). However, as this would not be possible in practice anyway (you always end up extending the abstract class), I think this test can be removed safely.

**Original Pull Request:** https://github.com/doctrine/orm/pull/1309 **State:** closed **Merged:** No --- The wrong class is chosen when hydrating embeddables that are part of a nested structure. See `DDC3582Test` for a demonstration. The fix is to use `class` instead of `embeddedClass` to instantiate the embeddable in ReflectionEmbeddedProperty. The test I removed from ReflectionEmbeddedPropertyTest was failing because you cannot instantiate an abstract class (and rightfully so). However, as this would not be possible in practice anyway (you always end up extending the abstract class), I think this test can be removed safely.
admin added the pull-request label 2026-01-22 16:04:07 +01:00
admin closed this issue 2026-01-22 16:04:07 +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#9370