You are here

basic_cart_order.install in Basic cart 7.2

Same filename and directory in other branches
  1. 7.3 basic_cart_order/basic_cart_order.install

Basic Cart Order install file

File

basic_cart_order/basic_cart_order.install
View source
<?php

/**
 * @file
 * Basic Cart Order install file
 */

/**
 * Implements hook_schema().
 */
function basic_cart_order_schema() {
  $schema['basic_cart_order_node'] = array(
    'description' => 'Basic cart order registration table.',
    'fields' => array(
      'oid' => array(
        'description' => 'The primary identifier for an order.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'nid' => array(
        'description' => 'Order node.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'quantity' => array(
        'description' => 'Order node quantity.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'oid',
      'nid',
    ),
  );
  return $schema;
}

/**
 * Implements hook_uninstall().
 */

// function basic_cart_order_uninstall() {
// Delete all nodes from this type. See node_delete_multiple($nids){}

/*$nids = db_select('node')
  ->fields('node', array('nid'))
  ->condition('type', 'order', '=')
  ->execute()
  ->fetchCol();*/

// node_delete_multiple($nids);
// Delete content type.
// node_type_delete('order');
// Delete view.
// $view = views_get_view('orders');
// $view->delete();
// views_delete_view($view);
// Delete user role: View basic cart orders.
// user_role_delete('view basic cart orders');
// Delete Orders menu item.

//}

Functions

Namesort descending Description
basic_cart_order_schema Implements hook_schema().