You are here

function uc_wishlist_get_wid in UC Wish List 7

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

Return the wish list ID of the specified user (defaults to current user).

10 calls to uc_wishlist_get_wid()
uc_product_update_wishlist_item in ./uc_wishlist.module
Update information about a specific item in current wish list.
uc_wishlist_add_item in ./uc_wishlist.module
Adds an item to a user's wish list.
uc_wishlist_add_items_to_cart in ./uc_wishlist.module
Adds wishlist items to the shopping cart.
uc_wishlist_display in ./uc_wishlist.pages.inc
Display a wish list for viewing or altering.
uc_wishlist_email_form in ./uc_wishlist.pages.inc
Email form for wishlist.

... See full list

File

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

Code

function uc_wishlist_get_wid($uid = NULL) {

  // Find the wish list matching the authenticated or anonymous user ID.
  // TODO: Handle multiple wishlists?
  if (empty($uid)) {
    $uid = uc_wishlist_get_uid();
  }
  return db_query("SELECT wid FROM {uc_wishlists} WHERE uid = :uid", array(
    ':uid' => $uid,
  ))
    ->fetchField();
}