Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
axelvnk opened this issue Feb 22, 2019 · 1 comment
Open

Comments

@axelvnk
Copy link

axelvnk commented Feb 22, 2019

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.

@Ocramius
Copy link
Member

@axelvnk can you please design a test case highlighting what the current system is doing, vs what you'd want it to do?

I'd expect references to "re-mapped" entities to be replaced also in discriminator maps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants