You are here

function user_role_load in Drupal 7

Same name and namespace in other branches
  1. 8 core/modules/user/user.module \user_role_load()

Fetches a user role by role ID.

Parameters

$rid: An integer representing the role ID.

Return value

A fully-loaded role object if a role with the given ID exists, or FALSE otherwise.

See also

user_role_load_by_name()

2 calls to user_role_load()
UserRoleAdminTestCase::testRoleWeightChange in modules/user/user.test
Test user role weight change operation.
user_role_delete in modules/user/user.module
Delete a user role from database.

File

modules/user/user.module, line 2995
Enables the user registration and login system.

Code

function user_role_load($rid) {
  return db_select('role', 'r')
    ->fields('r')
    ->condition('rid', $rid)
    ->execute()
    ->fetchObject();
}