You are here

function commerce_invoice_entity_info in Commerce Invoice 7

Same name and namespace in other branches
  1. 7.2 commerce_invoice.module \commerce_invoice_entity_info()

Implements hook_entity_info().

File

./commerce_invoice.module, line 27
Generates the invoice and allows you to display an invoice id in views

Code

function commerce_invoice_entity_info() {
  $return = array(
    'commerce_invoice' => array(
      'label' => t('Commerce Invoice'),
      'controller class' => 'CommerceInvoiceEntityController',
      'base table' => 'commerce_invoice',
      'fieldable' => TRUE,
      'entity keys' => array(
        'id' => 'invoice_id',
        'bundle' => 'type',
        'label' => 'invoice_number',
      ),
      'bundle keys' => array(
        'bundle' => 'type',
      ),
      'bundles' => array(
        'commerce_invoice' => array(
          'label' => t('Invoice', array(), array(
            'context' => 'a drupal commerce invoice',
          )),
        ),
      ),
      'load hook' => 'commerce_invoice_load',
      'view modes' => array(
        'administrator' => array(
          'label' => t('Administrator'),
          'custom settings' => FALSE,
        ),
        'customer' => array(
          'label' => t('Customer'),
          'custom settings' => FALSE,
        ),
      ),
      'creation callback' => '_commerce_invoice_create',
      'save callback' => 'commerce_invoice_save',
      'deletion callback' => 'commerce_invoice_delete',
      'access callback' => 'commerce_entity_access',
      'access arguments' => array(
        'user key' => 'uid',
        'access tag' => 'commerce_invoice_access',
      ),
      'token type' => 'commerce-invoice',
      'permission labels' => array(
        'singular' => t('invoice'),
        'plural' => t('invoices'),
      ),
    ),
  );
  return $return;
}