Fixed syntax- getEntityManager is deprecated since Symfony 2.1.