Skip to content

Use ResolveTargetEntityListener to remap the discriminatorMap with STI/JTI #7622

Open
@axelvnk

Description

@axelvnk

Feature Request

I ran into an issue past week and couldn't figure out what I was doing wrong. At the company I work at, we've created some bundles for reuse. We use interfaces in the association mapping, so we can extend entities and have the associations within the bundle to be remapped with the concrete classes.

I made the mistake to assume that the ResolveTargetEntityListener would also remap the discriminatorMap for STI/JTI entities. It seemed so evident to me that this would also work. I realise the name of the listener itself says ResolveTargetEntityListener and so it would only resolve the targetEntity properties of the association mappings. I find resolving target entities such a powerful feature, for extensibility in vendor libraries/bundles, that it's a shame I am forced to extend the STI/JTI entity whenever I extend an entity from the discriminatorMap,, because I need to change the discriminatorMap with the new concrete class.

Q A
New Feature yes
RFC yes/no
BC Break yes/no

Summary

I suggest either creating a new listener, ResolveDiscriminatorMapListener or renaming the current listener to something else and add the feature to remap the discriminatorMap.

I wonder what your thoughts are. I'm happy to do this myself and open up a PR if there's interest in such feature.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions