em = $em; } /** * @return Visit[] */ public function getUnlocatedVisits() { /** @var VisitRepository $repo */ $repo = $this->em->getRepository(Visit::class); return $repo->findUnlocatedVisits(); } /** * @param Visit $visit */ public function saveVisit(Visit $visit) { $this->em->persist($visit); $this->em->flush(); } }