You are here

function uc_order_entity_info in Ubercart 7.3

Same name and namespace in other branches
  1. 5 uc_order/uc_order_workflow.inc \uc_order_entity_info()

Implements hook_entity_info().

File

uc_order/uc_order.module, line 514

Code

function uc_order_entity_info() {
  return array(
    'uc_order' => array(
      'label' => t('Order'),
      'controller class' => 'UcOrderController',
      'base table' => 'uc_orders',
      'fieldable' => TRUE,
      'entity keys' => array(
        'id' => 'order_id',
      ),
      'bundles' => array(
        'uc_order' => array(
          'label' => t('Order'),
          'admin' => array(
            'path' => 'admin/store/settings/orders',
            'access arguments' => array(
              'administer store',
            ),
          ),
        ),
      ),
      'view modes' => array(
        'view' => array(
          'label' => t('Admin view'),
        ),
        'customer' => array(
          'label' => t('Customer view'),
        ),
      ),
      'uri callback' => 'uc_order_uri',
      // Entity API callbacks.
      'access callback' => 'uc_order_order_entity_access',
      'creation callback' => 'uc_order_create',
      'save callback' => 'uc_order_save',
      'deletion callback' => 'uc_order_delete',
    ),
    'uc_order_product' => array(
      'label' => t('Order product'),
      'base table' => 'uc_order_products',
      'controller class' => 'UcOrderProductController',
      'metadata controller class' => 'UcOrderProductMetadataController',
      'fieldable' => TRUE,
      'module' => 'uc_order',
      'entity keys' => array(
        'id' => 'order_product_id',
      ),
      'bundles' => array(
        'uc_order_product' => array(
          'label' => t('Order product'),
          'admin' => array(
            'path' => 'admin/store/settings/orders/products',
            'access arguments' => array(
              'administer store',
            ),
          ),
        ),
      ),
      'view modes' => array(
        'full' => array(
          'label' => t('Normal view'),
        ),
        'cart' => array(
          'label' => t('Cart view'),
        ),
      ),
      // Entity API callbacks.
      'access callback' => 'uc_order_order_product_access',
    ),
  );
}