Replaced deprecated call to getEntityManager with getManager