em->find(Invoice::class, $id); } public function findByFrappeInvoiceId(string $frappeInvoiceId): ?Invoice { return $this->em->getRepository(Invoice::class)->findOneBy(['frappeInvoiceId' => $frappeInvoiceId]); } public function save(Invoice $invoice): void { $this->em->persist($invoice); $this->em->flush(); } }