home | career | drupal | java | mac | mysql | perl | php | scala | uml | unix

Drupal example source code file (uc_cart_links.install)

This example Drupal source code file (uc_cart_links.install) is included in the DevDaily.com "Drupal Source Code Warehouse" project. The intent of this project is to help you "Learn Drupal by Example".

PHP - Drupal tags/keywords

array, cart, default, description, directory, file, function, link, null, php, the, true, type

The uc_cart_links.install Drupal example source code

<?php
// $Id: uc_cart_links.install,v 1.2.2.8 2010/08/11 17:52:20 islandusurper Exp $

/**
 * @file
 * uc_cart_links module install file.
 */

/**
 * Implementation of hook_schema().
 */
function uc_cart_links_schema() {
  $schema['uc_cart_link_clicks'] = array(
    'description' => 'Stores information for cart links.',
    'fields' => array(
      'cart_link_id' => array(
        'description' => 'The cart link identifier.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '0',
      ),
      'clicks' => array(
        'description' => 'The number of times this cart link was clicked.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'last_click' => array(
        'description' => 'The time of the last click on this cart link, stored as a UNIX timestamp.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'cart_link_id'
    ),
  );

  return $schema;
}


/**
 * Implementation of hook_install().
 */
function uc_cart_links_install() {
  drupal_install_schema('uc_cart_links');
}

/**
 * Implementation of hook_uninstall().
 */
function uc_cart_links_uninstall() {
  drupal_uninstall_schema('uc_cart_links');
  db_query("DELETE FROM {variable} WHERE name LIKE 'uc_cart_links_%%'");
  cache_clear_all('variables', 'cache');
}

/**
 * Remove obsolete variable.
 */
function uc_cart_links_update_6001() {
  variable_del('uc_cart_links_empty');

  return array();
}

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal uc_cart_links.install source code file:

new blog posts

"Drupal" is a registered trademark of Dries Buytaert.

my drupal tutorials and examples  

Copyright 1998-2016 Alvin Alexander, alvinalexander.com
All Rights Reserved.

Beginning in 2016, a portion of the proceeds from pages under the '/drupal-code-examples/' URI will be donated to charity.