You are here

function _og_features_role_exists in Organic groups 7.2

Returns rid if role with $name exists, FALSE otherwise.

Parameters

string $name: The role name

string $group_type: The entity type

string $bundle: The bundle

Return value

mixed Integer indicating rid if the role exists FALSE otherwise.

2 calls to _og_features_role_exists()
og_features_permission_features_rebuild in includes/og_features_permission.features.inc
Implements hook_features_rebuild().
og_features_role_features_rebuild in includes/og_features_role.features.inc
Implements hook_features_rebuild().

File

includes/og_features_role.features.inc, line 132
Integration with features for og roles.

Code

function _og_features_role_exists($name, $group_type, $bundle) {
  $roles = og_roles($group_type, $bundle, 0);
  if (in_array($name, $roles)) {
    $flipped = array_flip($roles);
    return $flipped[$name];
  }
  else {
    return FALSE;
  }
}