createQueryBuilder('p') ->orderBy('p.version', 'DESC') ->setMaxResults(1) ->getQuery() ->getOneOrNullResult(); } public function findActive(): ?IngestProfile { return $this->findOneBy(['active' => true]); } public function remove(string $id): void { $entity = $this->find($id); if (!$entity instanceof IngestProfile) { return; } $em = $this->getEntityManager(); $em->remove($entity); $em->flush(); } }