You are here

function role_export_roles in Role Export 7

Same name and namespace in other branches
  1. 6 role_export.module \role_export_roles()

Create an array with the current roles in the system and the associated data from the 'role' table. We cannot use user_roles() here as it only returns role ids and names, but no machine name.

2 calls to role_export_roles()
role_export_form_alter in ./role_export.module
Implements hook_form_alter().
role_export_role_name_exists in ./role_export.module
Check if the machine name of the new role already exists.

File

./role_export.module, line 104
Role Export's primary module file.

Code

function role_export_roles() {
  $roles = db_select('role')
    ->fields('role')
    ->execute()
    ->fetchAllAssoc('rid');
  return $roles;
}