JMSSerializerBundle
JMSSerializerBundle copied to clipboard
Single table inheritance
Hi,
I don't know if there is a bug or if I do it the wrong way or if this is impossible.
I use single table inheritance in doctrine and I wanted to change the way JMS serializes the entity according to the entity class.
In my single table inheritance, I have a type column which is used to map the discriminator value.
My parent entity is BundleNamespace\Entity\Question. When type is single_choice, my entity is BundleNamespace\Entity\Question\SingleChoiceQuestion. When type is multiples_choice, my entity is BundleNamespace\Entity\Question\MultipleChoiceQuestion.
I configured jms in config.yml
jms_serializer:
metadata:
directories:
exam:
namespace_prefix: "BundleNamespace"
path: "@BundleNamespace/Resources/config/serializer"
However when I create a yaml serializer file specific for each child entity, it does not seem to apply the right configuration file :
- @BundleNamespace/Resources/config/serializer/Entity.Question.SingleChoiceQuestion.yml
- @BundleNamespace/Resources/config/serializer/Entity.Question.MultipleChoiceQuestion.yml
Thans in advance
Best regards
+1
Serialize rules in child entities on Single Table inheritance are ingored.
+1 Is anyone else trying to serialize/deserialize an entity that uses single table inheritance?
Hey guys! I want to exclude discriminator field. Did anyone figure out how to do it??