function _favorites_load_favorites_db in Favorites 7.2
Same name and namespace in other branches
- 7 favorites.module \_favorites_load_favorites_db()
Helper function: Load an account's favorites from the DB.
Used to abstract the storage model (cookie vs. db).
Parameters
$account: The user account object to load the favorites for.
Return value
array An array with DB result rows (favorite objects), if any.
See also
1 call to _favorites_load_favorites_db()
- favorites_load_favorites in ./
favorites.module - Load the favorites for a particular user.
File
- ./
favorites.module, line 537 - The favorites module allows users to bookmark any path within a site.
Code
function _favorites_load_favorites_db($account) {
return db_select('favorites', 'f')
->fields('f')
->condition('uid', $account->uid, '=')
->orderBy('weight', 'ASC')
->orderBy('timestamp', 'DESC')
->execute();
}