title: Add extra fields using JMS Serializer bundle
body: <p>I've an entity I usually serialize using the JMS Serializer bundle. I have to add to the serialization some fields that doesn't reside in the entity itself but are gathered with some db queries.</p>
  
  <p>My idea was to create a custom object, fill the fields with the entity fields and add the custom one. But this seems a bit tricky and expensive to do for every variation (I use lot of serialization groups) of the class.</p>
  
  <p>Is there a better/standard way to do this? Using a factory? Pre/Post serialization events?</p>
  
  <p>Maybe I can listen for the serialization and checking entity type and serialization groups add the custom fields? But instead of making a query for each entity it would be better to gather all the data of the related entities and then add it to them. Any help is appreciated</p>