Invoice/EventListener/AbstractInvoiceListener.php
public function onPreUpdate(ResourceEventInterface $event)
    {
        $invoice = $this->getInvoiceFromEvent($event);

        /*if (null !== $invoice->getShipment()) {
            throw new Exception\IllegalOperationException(
                "Invoice (or credit) associated with a shipment (or return) can't be modified."
            );
        }*/

        // Pre load sale's invoices collection
        /** @var InvoiceSubjectInterface $sale */
        $sale = $invoice->getSale();
        $sale->getInvoices()->toArray();
    }
public function onPreUpdate(ResourceEventInterface $event)
    {
        $invoice = $this->getInvoiceFromEvent($event);

        /*if (null !== $invoice->getShipment()) {
            throw new Exception\IllegalOperationException(
                "Invoice (or credit) associated with a shipment (or return) can't be modified."
            );
        }*/

        // Pre load sale's invoices collection
        /** @var InvoiceSubjectInterface $sale */
        $sale = $invoice->getSale();
        $sale->getInvoices()->toArray();
    }
public function onPreUpdate ( ResourceEventInterface $ event ) { $ invoice = $ this -> getInvoiceFromEvent ( $ event ) ; /*if (null !== $invoice->getShipment()) {
            throw new Exception\IllegalOperationException(
                "Invoice (or credit) associated with a shipment (or return) can't be modified."
            );
        }*/ // Pre load sale's invoices collection /** @var InvoiceSubjectInterface $sale */ $ sale = $ invoice -> getSale ( ) ; $ sale -> getInvoices ( ) -> toArray ( ) ; }
Pre update event handler.

@param ResourceEventInterface $event
Pre update event handler .