You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Symfony does not currently support an easy way to register more mapping types on DiscriminatorMap. This is an important feature for modularity.
Currently a programmer must:
Create a compiler pass to replace first argument of LoaderChain and SerializerCacheWarmer services.
Replace whole ClassDiscriminatorMapping object.
There is a simple change to solve the current not friendly way:
Add serializer.loader tag to register custom loaders.
Add addType(string $type, string $class) method to ClassDiscriminatorMapping class. This point is not important as the first.
Remove internal annotation from ClassMetadataInterface. Is there a reason to mark this class as internal?
For example, Doctrine allows you to dynamically register more types via loadClassMetadata event and ClassMetadataInfo::addDiscriminatorMapClass method.
Description
Symfony does not currently support an easy way to register more mapping types on DiscriminatorMap. This is an important feature for modularity.
Currently a programmer must:
LoaderChain
andSerializerCacheWarmer
services.ClassDiscriminatorMapping
object.There is a simple change to solve the current not friendly way:
serializer.loader
tag to register custom loaders.addType(string $type, string $class)
method toClassDiscriminatorMapping
class. This point is not important as the first.internal
annotation fromClassMetadataInterface
. Is there a reason to mark this class as internal?For example, Doctrine allows you to dynamically register more types via
loadClassMetadata
event andClassMetadataInfo::addDiscriminatorMapClass
method.Example
Before
After
The text was updated successfully, but these errors were encountered: