Skip to content

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

Closed
@mpdude

Description

@mpdude

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.

// Evaluate annotations on properties/fields
foreach ($class->getProperties() as $property) {
if (
$metadata->isMappedSuperclass && ! $property->isPrivate()
||
$metadata->isInheritedField($property->name)
||
$metadata->isInheritedAssociation($property->name)
||
$metadata->isInheritedEmbeddedClass($property->name)
) {
continue;
}

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 #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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions