getEntityManager() is deprecated since Symfony 2.1.

see https://github.com/doctrine/DoctrineBundle/blob/master/Registry.php#L71