function uc_wishlist_load in UC Wish List 7
Same name and namespace in other branches
- 8 uc_wishlist.module \uc_wishlist_load()
- 6 uc_wishlist.module \uc_wishlist_load()
Load a wish list object from the database.
Parameters
numeric $wid: The wish list ID to load; if NULL, looks for the current user's wish list.
Return value
object A wish list object.
5 calls to uc_wishlist_load()
- uc_wishlist_display in ./
uc_wishlist.pages.inc - Display a wish list for viewing or altering.
- uc_wishlist_form_alter in ./
uc_wishlist.module - Implements hook_form_alter().
- uc_wishlist_settings_form_validate in ./
uc_wishlist.pages.inc - Validation handler for wish list settings form.
- uc_wishlist_uc_order in ./
uc_wishlist.module - Implements hook_uc_order().
- uc_wishlist_user_display in ./
uc_wishlist.pages.inc - Display a wishlist in user account page.
File
- ./
uc_wishlist.module, line 571 - Allows users to create public shopping/wish lists.
Code
function uc_wishlist_load($wid) {
if (empty($wid)) {
$wid = uc_wishlist_get_wid();
}
if (!$wid || !is_numeric($wid)) {
return FALSE;
}
$result = db_query("SELECT * FROM {uc_wishlists} WHERE wid = :wid", array(
':wid' => $wid,
));
if ($wishlist = $result
->fetchObject()) {
$wishlist->address = unserialize($wishlist->address);
return $wishlist;
}
}