You are here

function commerce_order_entity_info in Commerce Core 7

Implements hook_entity_info().

File

modules/order/commerce_order.module, line 12
Defines the core Commerce order entity and API functions to manage orders and interact with them.

Code

function commerce_order_entity_info() {
  $return = array(
    'commerce_order' => array(
      'label' => t('Commerce Order', array(), array(
        'context' => 'a drupal commerce order',
      )),
      'controller class' => 'CommerceOrderEntityController',
      'locking mode' => 'pessimistic',
      'base table' => 'commerce_order',
      'revision table' => 'commerce_order_revision',
      'load hook' => 'commerce_order_load',
      'uri callback' => 'commerce_order_uri',
      'label callback' => 'commerce_order_label',
      'fieldable' => TRUE,
      'entity keys' => array(
        'id' => 'order_id',
        'revision' => 'revision_id',
        'bundle' => 'type',
      ),
      'bundle keys' => array(
        'bundle' => 'type',
      ),
      'bundles' => array(
        'commerce_order' => array(
          'label' => t('Order', array(), array(
            'context' => 'a drupal commerce order',
          )),
        ),
      ),
      'view modes' => array(
        'administrator' => array(
          'label' => t('Administrator'),
          'custom settings' => FALSE,
        ),
        'customer' => array(
          'label' => t('Customer'),
          'custom settings' => FALSE,
        ),
      ),
      'token type' => 'commerce-order',
      'metadata controller class' => '',
      'access callback' => 'commerce_entity_access',
      'access arguments' => array(
        'user key' => 'uid',
        'access tag' => 'commerce_order_access',
      ),
      'permission labels' => array(
        'singular' => t('order'),
        'plural' => t('orders'),
      ),
      // // Prevent Redirect alteration of the order form.
      'redirect' => FALSE,
    ),
  );
  return $return;
}