Call of doctrine manager

getEntityManager()  is deprecated in symfony 2.3