You are here

public function Invoice::getNumberPattern in Commerce Invoice 7.2

Returns the invoice number pattern for this invoice.

@todo bundle settings logic

Return value

InvoiceNumberPattern

File

src/Entity/Invoice.php, line 45
Invoice entity.

Class

Invoice

Namespace

Drupal\commerce_invoice\Entity

Code

public function getNumberPattern() {
  if ($pattern = commerce_invoice_number_pattern_load($this->number_pattern)) {
    return $pattern;
  }
  throw new \RuntimeException('Invoice number pattern not found: ' . $this->number_pattern);
}