public function __construct(ObjectManager $om, $class) { $this->objectManager = $om; $this->repository = $om->getRepository($class); $this->class = $class; }