/** * Cancel invoice and register order cancellation * * @param Invoice|false $invoice * @param string $message */ protected function cancelInvoiceAndRegisterCancellation($invoice, $message) { if ($invoice instanceof Invoice) { $invoice->cancel(); $this->getOrder()->addRelatedObject($invoice); } $this->getOrder()->registerCancellation($message, false); }