If $manager is not in the constructor it will not be able to $this->manager->getClassMetadata...