[PR #5809] Verify embeddables do not define associations #9734

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

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

State: closed
Merged: No


If I define an association on an embeddable, the following happens:

  • The schema validates without errors;
  • Yet my association is ignored!

There are two ways to solve this problem: invalidate the schema, or add associations of the embeddable.

Personally I would find it intuitive if the associations work. Currently we've placed a workaround, but we'd prefer adding the association mapping in the embeddable.

According to #4291, Doctrine consciously does not support associations in embeddables. That is why I opted for stricter validation. That way the error would have at least been found sooner.

**Original Pull Request:** https://github.com/doctrine/orm/pull/5809 **State:** closed **Merged:** No --- If I define an association on an embeddable, the following happens: - The schema validates without errors; - Yet my association is ignored! There are two ways to solve this problem: invalidate the schema, or add associations of the embeddable. Personally I would find it intuitive if the associations work. Currently we've placed a workaround, but we'd prefer adding the association mapping in the embeddable. According to #4291, Doctrine consciously does not support associations in embeddables. That is why I opted for stricter validation. That way the error would have at least been found sooner.
admin added the pull-request label 2026-01-22 16:05:15 +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#9734