Skip to content

AnnotationDriver handles field mappings differently #5744

Closed
@dylanschoenmakers

Description

@dylanschoenmakers

A problem with a mapped superclass led me to this piece of code that conditionally maps fields in the loadMetadataForClass method in the AnnotationDriver. See commit 09a48a8

    public function loadMetadataForClass($className, ClassMetadata $metadata)
    {
…
        // Evaluate annotations on properties/fields
        /* @var $property \ReflectionProperty */
        foreach ($class->getProperties() as $property) {
            if ($metadata->isMappedSuperclass && ! $property->isPrivate()
                ||
                $metadata->isInheritedField($property->name)
                ||
                $metadata->isInheritedAssociation($property->name)
                ||
                $metadata->isInheritedEmbeddedClass($property->name)) {
                continue;
            }

Other drivers like yaml or xml don't have these conditions, or not that I can see. Does anyone have more information about this or has encountered the same problems with overriding field mappings with annotations?

Metadata

Metadata

Assignees

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