public function findByInvoice(Invoice $invoice)
 {
     $qb = $this->getEntityManager()->createQueryBuilder();
     $qb->select('ri')->from(RecurringInvoice::class, 'ri')->join('ri.invoices', 'i')->where('i.id = ?1')->setParameter(1, $invoice->getId());
     return $qb->getQuery()->getResult();
 }