You are here

commerce_invoice.views.inc in Commerce Invoice 7.2

Views integration for the Commerce Invoice module.

File

commerce_invoice.views.inc
View source
<?php

/**
 * @file
 * Views integration for the Commerce Invoice module.
 */

/**
 * Implements hook_views_data().
 */
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;
}

Functions