DDC-2684: SchemaValidator does not correctly validate association mappings target entities #3363

Closed
opened 2026-01-22 14:18:37 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (Sep 17, 2013).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user jurgenf:

The schema validator checks if the target entity exists and if the target entity is transient. It does so with the following comparison:

if (!class_exists($assoc['targetEntity']) ](| $cmf->isTransient($assoc['targetEntity')))

If I understand this comparison correctly it should evaluate to true if $cmf->isTransient is NOT true because the entity is unknown to the driver in this case. If both the class exists and is a registered entity (is transient) then the association is valid.

Originally created by @doctrinebot on GitHub (Sep 17, 2013). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user jurgenf: The schema validator checks if the target entity exists and if the target entity is transient. It does so with the following comparison: `if (!class_exists($assoc['targetEntity']) ](| $cmf->isTransient($assoc['targetEntity')))` If I understand this comparison correctly it should evaluate to true if $cmf->isTransient is NOT true because the entity is unknown to the driver in this case. If both the class exists and is a registered entity (is transient) then the association is valid.
admin added the Bug label 2026-01-22 14:18:37 +01:00
admin closed this issue 2026-01-22 14:18:37 +01:00
Author
Owner

@doctrinebot commented on GitHub (Sep 17, 2013):

Comment created by @ocramius:

[~jurgenf] the entity may be transient within a single driver, but not necessarily in the entire class metadata factory

@doctrinebot commented on GitHub (Sep 17, 2013): Comment created by @ocramius: [~jurgenf] the entity may be transient within a single driver, but not necessarily in the entire class metadata factory
Author
Owner

@doctrinebot commented on GitHub (Sep 27, 2013):

Comment created by jurgenf:

The problem was in a custom metadata driver that returned the wrong transient state.

@doctrinebot commented on GitHub (Sep 27, 2013): Comment created by jurgenf: The problem was in a custom metadata driver that returned the wrong transient state.
Author
Owner

@doctrinebot commented on GitHub (Sep 27, 2013):

Issue was closed with resolution "Invalid"

@doctrinebot commented on GitHub (Sep 27, 2013): Issue was closed with resolution "Invalid"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#3363