function user_role_load

user_role_load($rid)

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()

File

modules/user/user.module, line 2971
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();
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!user!user.module/function/user_role_load/7.x