You are here

function uc_discounts_load in Ubercart Discounts (Alternative) 7.2

Same name and namespace in other branches
  1. 6.2 uc_discounts/uc_discounts.module \uc_discounts_load()

Load discount by discount ID.

Parameters

int $discount_id:

Return value

object

4 calls to uc_discounts_load()
uc_discounts_admin_discount_copy_form in uc_discounts/uc_discounts.admin.inc
Generates admin form to create a copy of existing discount.
uc_discounts_admin_discount_delete_form in uc_discounts/uc_discounts.admin.inc
Generates an admin form to delete a discount.
uc_discounts_admin_discount_delete_form_submit in uc_discounts/uc_discounts.admin.inc
Submit handler for uc_discounts_admin_discount_delete_form().
uc_discounts_admin_discount_edit_form in uc_discounts/uc_discounts.admin.inc
Generates admin form to create or edit a discount.

File

uc_discounts/uc_discounts.module, line 883

Code

function uc_discounts_load($discount_id) {
  $discount = db_query("SELECT *\n                       FROM {uc_discounts}\n                       WHERE discount_id = :discount_id", array(
    ':discount_id' => $discount_id,
  ))
    ->fetchObject();
  foreach (module_implements('uc_discount') as $module) {
    $function = $module . '_uc_discount';
    $function('load', $discount);
  }
  return $discount;
}