[PR #1433] Check for non-cacheable entities on metadata level, not at runtime #9495

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

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

State: closed
Merged: Yes


This PR moves the check for non-cacheable entities from "runtime" to metadata definition.

If an entity has an association key as part of its PK, and this association key is not configured to be stored into SLC, an exception it thrown.

The previous approach was checking this constraint at "runtime" (right before saving the value), this PR moves this check at metadata level into (_validateAndCompleteAssociationMapping method).

testQueryNotCacheableAssociationException ther has been removed since this constraint is checked at metadata class loading time

**Original Pull Request:** https://github.com/doctrine/orm/pull/1433 **State:** closed **Merged:** Yes --- This PR moves the check for non-cacheable entities from "runtime" to metadata definition. If an entity has an association key as part of its PK, and this association key is not configured to be stored into SLC, an exception it thrown. The previous approach was checking this constraint at "runtime" (right before saving the value), this PR moves this check at metadata level into (`_validateAndCompleteAssociationMapping` method). `testQueryNotCacheableAssociationException` ther has been removed since this constraint is checked at metadata class loading time
admin added the pull-request label 2026-01-22 16:04:29 +01:00
admin closed this issue 2026-01-22 16:04:29 +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#9495