Fix calling of deprecated doctrine method