function social_group_get_all_group_members in Open Social 8
Same name and namespace in other branches
- 8.9 modules/social_features/social_group/social_group.module \social_group_get_all_group_members()
- 8.2 modules/social_features/social_group/social_group.module \social_group_get_all_group_members()
- 8.3 modules/social_features/social_group/social_group.module \social_group_get_all_group_members()
- 8.4 modules/social_features/social_group/social_group.module \social_group_get_all_group_members()
- 8.5 modules/social_features/social_group/social_group.module \social_group_get_all_group_members()
- 8.6 modules/social_features/social_group/social_group.module \social_group_get_all_group_members()
- 8.7 modules/social_features/social_group/social_group.module \social_group_get_all_group_members()
- 8.8 modules/social_features/social_group/social_group.module \social_group_get_all_group_members()
- 10.3.x modules/social_features/social_group/social_group.module \social_group_get_all_group_members()
- 10.0.x modules/social_features/social_group/social_group.module \social_group_get_all_group_members()
- 10.1.x modules/social_features/social_group/social_group.module \social_group_get_all_group_members()
- 10.2.x modules/social_features/social_group/social_group.module \social_group_get_all_group_members()
Get all group memberships for a certain user.
2 calls to social_group_get_all_group_members()
- ActivityFilterPersonalisedHomepage::query in modules/
custom/ activity_viewer/ src/ Plugin/ views/ filter/ ActivityFilterPersonalisedHomepage.php - Filters out activity items the user is not allowed to see.
- ActivityPostVisibilityAccess::query in modules/
custom/ activity_viewer/ src/ Plugin/ views/ filter/ ActivityPostVisibilityAccess.php - Filters out activity items the user is not allowed to see.
File
- modules/
social_features/ social_group/ social_group.module, line 1110 - The Social group module.
Code
function social_group_get_all_group_members($uid) {
$group_content_types = GroupContentType::loadByEntityTypeId('user');
$group_content_types = array_keys($group_content_types);
$query = \Drupal::database()
->select('group_content_field_data', 'gcfd');
$query
->addField('gcfd', 'gid');
$query
->condition('gcfd.entity_id', $uid);
$query
->condition('gcfd.type', $group_content_types, 'IN');
$query
->execute()
->fetchAll();
$group_ids = $query
->execute()
->fetchAllAssoc('gid');
return array_keys($group_ids);
}