changed getEntityManager to getManager
changed deprecated getRequest to get('request_stack')->getCurrentRequest()