You are here

function social_group_group_content_update in Open Social 8.3

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.4 modules/social_features/social_group/social_group.module \social_group_group_content_update()
  5. 8.5 modules/social_features/social_group/social_group.module \social_group_group_content_update()
  6. 8.6 modules/social_features/social_group/social_group.module \social_group_group_content_update()
  7. 8.7 modules/social_features/social_group/social_group.module \social_group_group_content_update()
  8. 8.8 modules/social_features/social_group/social_group.module \social_group_group_content_update()
  9. 10.0.x modules/social_features/social_group/social_group.module \social_group_group_content_update()
  10. 10.1.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 584
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());
    }
  }
}