Modified getEntityManager to protected