code: public function onDelete(ResourceEventInterface $event)
      {
          $line = $this->getInvoiceLineFromEvent($event);
  
          $this->stockUnitAssigner->detachInvoiceLine($line);
  
          // Get invoice from change set if null
          if (null === $invoice = $line->getInvoice()) {
              $invoice = $this->persistenceHelper->getChangeSet($line, 'invoice')[0];
          }
  
          $this->scheduleInvoiceContentChangeEvent($invoice);
      }
docs: Delete event handler.
  
  @param ResourceEventInterface $event