Make Entity source forward-compatible

Since Symfony 2.1, the call to doctrine ``getEntityManager`` is deprecated. https://github.com/doctrine/DoctrineBundle/blob/master/Registry.php#L71