You are here

function commerce_invoice_views_data in Commerce Invoice 7.2

Same name and namespace in other branches
  1. 7 includes/views/commerce_invoice.views.inc \commerce_invoice_views_data()

Implements hook_views_data().

File

./commerce_invoice.views.inc, line 10
Views integration for the Commerce Invoice module.

Code

function commerce_invoice_views_data() {
  $data = [];
  $data['commerce_invoice']['invoice_number'] = [
    'title' => t('Invoice number'),
    'help' => t('The invoice number'),
    'field' => [
      'handler' => '\\Drupal\\commerce_invoice\\InvoiceNumber\\ViewsField',
      'click sortable' => TRUE,
      'real field' => 'number_sequence',
      'additional fields' => [
        'number_pattern',
        'number_key',
      ],
    ],
    'sort' => [
      'handler' => '\\Drupal\\commerce_invoice\\InvoiceNumber\\ViewsSort',
    ],
  ];
  return $data;
}