Invoice/EventListener/AbstractInvoiceLineListener.php
protected function preventForbiddenChange(Model\InvoiceLineInterface $line)
    {
        if ($this->persistenceHelper->isChanged($line, 'type')) {
            list($old, $new) = $this->persistenceHelper->getChangeSet($line, 'type');
            if ($old !== $new) {
                throw new Exception\RuntimeException("Changing the invoice line's type is not supported.");
            }
        }
    }
protected function preventForbiddenChange(Model\InvoiceLineInterface $line)
    {
        if ($this->persistenceHelper->isChanged($line, 'type')) {
            list($old, $new) = $this->persistenceHelper->getChangeSet($line, 'type');
            if ($old !== $new) {
                throw new Exception\RuntimeException("Changing the invoice line's type is not supported.");
            }
        }
    }
Prevents some of the invoice line fields from changing.

@param Model\InvoiceLineInterface $line