You are here

function uc_wishlist_load in UC Wish List 6

Same name and namespace in other branches
  1. 8 uc_wishlist.module \uc_wishlist_load()
  2. 7 uc_wishlist.module \uc_wishlist_load()

Load a wish list object from the database.

Parameters

$wid: The ID of the wish list to load; if NULL, looks for the current user's wish list.

Return value

A wish list object.

5 calls to uc_wishlist_load()
uc_wishlist_cart_item in ./uc_wishlist.module
Implements Ubercart hook_cart_item
uc_wishlist_display in ./uc_wishlist.pages.inc
Display a wish list for viewing or altering.
uc_wishlist_form_alter in ./uc_wishlist.module
Implementation of hook_form_alter().
uc_wishlist_order in ./uc_wishlist.module
Implements Ubercart hook_order.
uc_wishlist_settings_form_validate in ./uc_wishlist.pages.inc

File

./uc_wishlist.module, line 492
Allows users to create public shopping/wish lists.

Code

function uc_wishlist_load($wid = NULL) {
  if (empty($wid)) {
    $wid = uc_wishlist_get_wid();
  }
  if (!$wid || !is_numeric($wid)) {
    return FALSE;
  }
  $result = db_query("SELECT * FROM {uc_wishlists} WHERE wid = %d", $wid);
  if ($wishlist = db_fetch_object($result)) {
    $wishlist->address = unserialize($wishlist->address);
    return $wishlist;
  }
  return FALSE;
}