Weird conditional skipping of mapping information in attribute/annotations driver #7095

Closed
opened 2026-01-22 15:44:35 +01:00 by admin · 4 comments
Owner

Originally created by @mpdude on GitHub (Jan 17, 2023).

I am looking into an issue where an invalid association definition on a mapped superclass is not rejected as it should be.

It turns out the assocation is not even reported by the mapping driver, due to the following lines of code.

69c7791ba2/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php (L345-L357)

This is present in the attribute driver as well. To add insult to injury, the thing I am trying to chase depends on wheter an association is mapped in a public or private property.

I have seen this exact piece of code has been questioned in https://github.com/doctrine/orm/issues/5744 before, but neither that nor the reference to #4198 help.

Can anybody help reasoning about this – what's the purpose of these continuations, and what does it have to do with private in mapped superclasses?

Maybe it has to do with that the Reflection API also reports non-private properties inherited from base classes, but I don't get it.

How do we want to treat such inherited properties, and/or can we tell whether a property was just inherited or inhertied + redeclared?

Originally created by @mpdude on GitHub (Jan 17, 2023). I am looking into an issue where an invalid association definition on a mapped superclass is not rejected as it should be. It turns out the assocation is not even reported by the mapping driver, due to the following lines of code. https://github.com/doctrine/orm/blob/69c7791ba256d947ddb1aafe5f2439ab31704937/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php#L345-L357 This is present in the attribute driver as well. To add insult to injury, the thing I am trying to chase depends on wheter an association is mapped in a `public` or `private` property. I have seen this exact piece of code has been questioned in https://github.com/doctrine/orm/issues/5744 before, but neither that nor the reference to #4198 help. Can anybody help reasoning about this – what's the purpose of these continuations, and what does it have to do with `private` in mapped superclasses? Maybe it has to do with that the Reflection API also reports non-private properties inherited from base classes, but I don't get it. How do we want to treat such inherited properties, and/or can we tell whether a property was just inherited or inhertied + redeclared?
admin closed this issue 2026-01-22 15:44:35 +01:00
Author
Owner

@mpdude commented on GitHub (Jan 19, 2023):

X-Ref #9702

@mpdude commented on GitHub (Jan 19, 2023): X-Ref #9702
Author
Owner

@mpdude commented on GitHub (Jan 24, 2023):

#10449, #10450 and #10454 show different ways how the conditions from the OP fail.

@mpdude commented on GitHub (Jan 24, 2023): #10449, #10450 and #10454 show different ways how the conditions from the OP fail.
Author
Owner

@mpdude commented on GitHub (Jan 25, 2023):

#10455 tries to fix the mapping driver.

@mpdude commented on GitHub (Jan 25, 2023): #10455 tries to fix the mapping driver.
Author
Owner

@mpdude commented on GitHub (May 8, 2023):

Closing, since #10455 has been merged and fixes this.

@mpdude commented on GitHub (May 8, 2023): Closing, since #10455 has been merged and fixes this.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#7095