Invoice/EventListener/AbstractInvoiceListener.php
protected function generateNumber(InvoiceInterface $invoice)
    {
        if (0 == strlen($invoice->getNumber())) {
            if (InvoiceTypes::isInvoice($invoice)) {
                $this->invoiceNumberGenerator->generate($invoice);
            } elseif (InvoiceTypes::isCredit($invoice)) {
                $this->creditNumberGenerator->generate($invoice);
            } else {
                throw new Exception\InvalidArgumentException("Unexpected invoice type.");
            }

            return true;
        }

        return false;
    }
protected function generateNumber(InvoiceInterface $invoice)
    {
        if (0 == strlen($invoice->getNumber())) {
            if (InvoiceTypes::isInvoice($invoice)) {
                $this->invoiceNumberGenerator->generate($invoice);
            } elseif (InvoiceTypes::isCredit($invoice)) {
                $this->creditNumberGenerator->generate($invoice);
            } else {
                throw new Exception\InvalidArgumentException("Unexpected invoice type.");
            }

            return true;
        }

        return false;
    }
protected function generateNumber ( InvoiceInterface $ invoice ) { if ( 0 == strlen ( $ invoice -> getNumber ( ) ) ) { if ( InvoiceTypes :: isInvoice ( $ invoice ) ) { $ this -> invoiceNumberGenerator -> generate ( $ invoice ) ; } elseif ( InvoiceTypes :: isCredit ( $ invoice ) ) { $ this -> creditNumberGenerator -> generate ( $ invoice ) ; } else { throw new Exception \ InvalidArgumentException ( "Unexpected invoice type." ) ; } return true ; } return false ; }
Generates the number.

@param InvoiceInterface $invoice

@return bool Whether the invoice number has been generated or not.
Generates the number .