borisguery/bgylibrary — pull request #5 by wildlyinaccurate (2012-09-17 18:32:42+00:00)
Title: Add recursion to EntitySerializer

I needed the ability to serialize related entities, so I came up with this.

Recursion is disabled by default, so no BC breaks. You can enable recursion by setting a max recursion depth, like so:

$serializer = new EntitySerializer($em);
$serializer->setMaxRecursionDepth(2);
$serializer->toArray($entity);