You are here

function user_badges_load_badges in User Badges 7.3

Same name and namespace in other branches
  1. 7.4 user_badges.module \user_badges_load_badges()

Helper function to load all the badges from the database

Return value

An array of badge objects

4 calls to user_badges_load_badges()
user_badges_block_view in ./user_badges.module
Implements hook_block_view().
user_badges_change_form in ./user_badges.module
Form to change badges of a user
user_badges_roles_form in ./user_badges.admin.inc
Form to associated badges with roles.
user_badges_rules_get_badge_names in ./user_badges.rules.inc
Function to load badges for options list

File

./user_badges.module, line 724
@brief User Badges module file

Code

function user_badges_load_badges() {

  //Load all the available badges from the database
  $result = db_select('user_badges_badges', 'ubb')
    ->fields('ubb')
    ->orderBy('ubb.weight', 'asc')
    ->orderBy('ubb.name', 'asc')
    ->execute();
  return $result;
}