title: Symfony2 JMS Serializer - modify certain values
body: <p>I have to work with an existing project and I have to modify some data before they are being serialized. A simple example: </p>
  
  <p>This is what my serializer returns at the moment: </p>
  
  <pre><code>[
    {
      "id": 3,
      "reward": "reg"
    }, 
    {
      "id": 4,
      "reward": "inv"
    }, 
  ]
  </code></pre>
  
  <p>And this is what I want returned: </p>
  
  <pre><code>[
    {
      "id": 3,
      "reward": "Registration"
    }, 
    {
      "id": 4,
      "reward": "inviting another user"
    }, 
  ]
  </code></pre>
  
  <p>I want to rewrite stupid strings that come from the database to actually readable outputs. So I have to run a <code>str_replace</code> over certain fields from certain entities. How can I achieve this? </p>
  
  <p>I tried creating my own visitor, but that seems to only have the possibility to change "visitString", which is not specific enough. Is there any other way to do this?</p>