Fix Deprecated getEntityManager from Symfony 2.1

Fix Deprecated getEntityManager from Symfony 2.1