You are here

function social_group_group_content_update in Open Social 10.1.x

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_group/social_group.module \social_group_group_content_update()
  2. 8 modules/social_features/social_group/social_group.module \social_group_group_content_update()
  3. 8.2 modules/social_features/social_group/social_group.module \social_group_group_content_update()
  4. 8.3 modules/social_features/social_group/social_group.module \social_group_group_content_update()
  5. 8.4 modules/social_features/social_group/social_group.module \social_group_group_content_update()
  6. 8.5 modules/social_features/social_group/social_group.module \social_group_group_content_update()
  7. 8.6 modules/social_features/social_group/social_group.module \social_group_group_content_update()
  8. 8.7 modules/social_features/social_group/social_group.module \social_group_group_content_update()
  9. 8.8 modules/social_features/social_group/social_group.module \social_group_group_content_update()
  10. 10.0.x modules/social_features/social_group/social_group.module \social_group_group_content_update()

When updating a group membership.

Parameters

\Drupal\group\Entity\GroupContentInterface $group_content: The group content.

File

modules/social_features/social_group/social_group.module, line 1219
The Social group module.

Code

function social_group_group_content_update(GroupContentInterface $group_content) {
  if ($group_content
    ->getEntity()
    ->getEntityTypeId() == 'user') {
    if ($group_content
      ->bundle() == $group_content
      ->getGroup()
      ->bundle() . '-group_membership') {
      _social_group_grant_admin_role($group_content
        ->getEntity()
        ->id(), $group_content
        ->getGroup()
        ->id());
    }
  }
}