You are here

class GroupRoleFeaturesController in Group 7

Main class for group role Features integration.

Hierarchy

Expanded class hierarchy of GroupRoleFeaturesController

1 string reference to 'GroupRoleFeaturesController'
group_entity_info in ./group.entity.inc
Implements hook_entity_info().

File

classes/group_role.features_controller.inc, line 10
Defines the Features integration class for group roles.

View source
class GroupRoleFeaturesController extends EntityDefaultFeaturesController {

  /**
   * Defines the result for hook_features_api().
   */
  public function api() {
    $return = parent::api();
    $return['group_role']['name'] = t('Group roles (global), including permissions');
    return $return;
  }

  /**
   * Generates the result for hook_features_export_options().
   */
  public function export_options() {
    $options = array();
    foreach (entity_load_multiple_by_name('group_role', FALSE) as $name => $group_role) {
      if ($group_role->global) {
        $options[$name] = $group_role
          ->label();
      }
    }
    return $options;
  }

}

Members