You are here

function commerce_braintree_enable in Commerce Braintree 7

Same name and namespace in other branches
  1. 7.3 commerce_braintree.install \commerce_braintree_enable()
  2. 7.2 commerce_braintree.install \commerce_braintree_enable()

Implements hook_enable().

File

./commerce_braintree.install, line 6

Code

function commerce_braintree_enable() {
  $weight = db_select('system', 's')
    ->fields('s', array(
    'weight',
  ))
    ->condition('name', 'commerce_cardonfile', '=')
    ->execute()
    ->fetchField();
  db_update('system')
    ->fields(array(
    'weight' => $weight + 1,
  ))
    ->condition('type', 'module')
    ->condition('name', 'commerce_braintree')
    ->execute();
}