Without getting into the naming discussion the example as it are instantiate an objectManager (here) but later try to call methods from an $entityManager (lines 1158 - 1159). Same on editAction