You are here

function uc_recurring_get_extension_list in UC Recurring Payments and Subscriptions 6.2

Same name and namespace in other branches
  1. 7.2 uc_recurring.module \uc_recurring_get_extension_list()

Retuns a list of all the extensions for a specific recurring fee.

Parameters

$fee_id: The id of the recurring fee to get extensions.

1 call to uc_recurring_get_extension_list()
uc_recurring_payment_form in ./uc_recurring.admin.inc
Recurring payment settings form.

File

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

Code

function uc_recurring_get_extension_list($fee_id = NULL) {
  if ($fee_id === NULL) {
    $result = db_query("SELECT * FROM {uc_recurring_extensions} WHERE pfid IS NULL ORDER BY pfid DESC, rebill_attempt ASC");
  }
  else {
    $result = db_query("SELECT * FROM {uc_recurring_extensions} WHERE (pfid = %d OR pfid IS NULL) ORDER BY pfid DESC, rebill_attempt ASC", $fee_id);
  }
  $extensions = array();
  while ($extension = db_fetch_object($result)) {
    if (!isset($extensions[$extension->rebill_attempt])) {
      $extensions[$extension->rebill_attempt] = $extension;
    }
  }
  return $extensions;
}