public function findById($id) { $er = $this->em->getRepository($this->options->getUserEntityClass()); return $er->find($id); }
public function __construct(DocumentManager $dm, ModuleOptions $options) { $this->dm = $dm; $this->options = $options; $this->entityClass = $this->options->getUserEntityClass(); }
public function findFirst() { $er = $this->em->getRepository($this->options->getUserEntityClass()); return isset($er->findAll()[0]) ? $er->findAll()[0] : array(); }