You are here

function uc_recurring_fee_delete in UC Recurring Payments and Subscriptions 6

Deletes a recurring fee from a product or user.

Parameters

$type: Either 'product' or 'user' to specify what type of delete needs to happen.

$id: The ID of the recurring fee to be removed from the appropriate table.

1 call to uc_recurring_fee_delete()
uc_recurring_admin_delete_form_submit in ./uc_recurring.admin.inc
1 string reference to 'uc_recurring_fee_delete'
uc_recurring_product_feature in ./uc_recurring.module
Implementation of hook_product_feature().

File

./uc_recurring.module, line 787
Allows you to add a recurring fee to a product/SKU to handle subscription type services.

Code

function uc_recurring_fee_delete($feature, $type = 'product') {
  switch ($type) {
    case 'product':
      db_query("DELETE FROM {uc_recurring_products} WHERE pfid = %d", $feature['pfid']);
      break;
    case 'user':
      module_invoke_all('recurring_api', 'delete', $feature['fid']);
      db_query("DELETE FROM {uc_recurring_users} WHERE rfid = %d", $feature['pfid']);
      break;
  }
}