You are here

function _social_user_get_groups in Open Social 10.3.x

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_user/social_user.module \_social_user_get_groups()
  2. 8.5 modules/social_features/social_user/social_user.module \_social_user_get_groups()
  3. 8.6 modules/social_features/social_user/social_user.module \_social_user_get_groups()
  4. 8.7 modules/social_features/social_user/social_user.module \_social_user_get_groups()
  5. 8.8 modules/social_features/social_user/social_user.module \_social_user_get_groups()
  6. 10.0.x modules/social_features/social_user/social_user.module \_social_user_get_groups()
  7. 10.1.x modules/social_features/social_user/social_user.module \_social_user_get_groups()
  8. 10.2.x modules/social_features/social_user/social_user.module \_social_user_get_groups()

Returns array with titles of all groups, ordered by their label.

1 call to _social_user_get_groups()
social_user_form_views_exposed_form_alter in modules/social_features/social_user/social_user.module
Implements hook_form_FORM_ID_alter().

File

modules/social_features/social_user/social_user.module, line 146
The social user module alterations.

Code

function _social_user_get_groups() {
  $data =& drupal_static(__FUNCTION__);
  if (empty($data)) {
    $data = \Drupal::database()
      ->select('groups_field_data', 'gfd')
      ->fields('gfd', [
      'id',
      'label',
    ])
      ->orderBy('label')
      ->execute()
      ->fetchAllKeyed(0, 1);
  }
  return $data;
}