title: Doctrine entity to Json using GetSetMethodNormalizer return fatal error
body: <p>I am using Doctrine 2 and Zend framework since a few days.
  I am generating my entities across yaml files.
  Now I met an issue to convert my entities Doctrine into Json format (in order to use it through AJAX).</p>
  
  <p>Here is the code used : </p>
  
  <pre><code>    $doctrineobject = $this-&gt;entityManager-&gt;getRepository('\Entity\MasterProduct')-&gt;find($this-&gt;_request-&gt;id);
      $serializer = new \Symfony\Component\Serializer\Serializer(array(new Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer()), array('json' =&gt; new Symfony\Component\Serializer\Encoder\JsonEncoder()));
  
      $reports = $serializer-&gt;serialize($doctrineobject, 'json');
  </code></pre>
  
  <p>below is the return I get : </p>
  
  <p>Fatal error: Maximum function nesting level of '100' reached, aborting! in /Users/Sites/library/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php on line 185</p>
  
  <p>the issue seems to be the same than here :
  <a href="http://comments.gmane.org/gmane.comp.php.symfony.symfony2/2659" rel="nofollow">http://comments.gmane.org/gmane.comp.php.symfony.symfony2/2659</a></p>
  
  <p>but there is not proper solution proposed.</p>
  
  <p>Any idea how can I do it ?</p>
  
  <p>Cheers</p>