src/services/Invoices.php
public function getInvoiceByReference(string $reference)
    {
        $invoiceRow = $this->_createInvoiceQuery()
            ->where(['reference' => $reference])
            ->one();

        if ($invoiceRow) {
            return new Invoice($invoiceRow);
        }

        return null;
    }
public function getInvoiceByReference(string $reference)
    {
        $invoiceRow = $this->_createInvoiceQuery()
            ->where(['reference' => $reference])
            ->one();

        if ($invoiceRow) {
            return new Invoice($invoiceRow);
        }

        return null;
    }
public function getInvoiceByReference ( string $ reference ) { $ invoiceRow = $ this -> _createInvoiceQuery ( ) -> where ( [ 'reference' => $ reference ] ) -> one ( ) ; if ( $ invoiceRow ) { return new Invoice ( $ invoiceRow ) ; } return null ; }
Get an invoice from the database by the invoice reference number. Returns null if not found.

@param string $reference
@return Invoice|null
Get an invoice from the database by the invoice reference number . Returns null if not found .